Perform a likelihood ratio chi-squared test between nested COM-Poisson models. The test statistics is calculated as 2*(llik- llik_0). The test statistics has degrees of freedom r where r is the difference in the number of parameters between the full and null models.
cmplrtest(object1, object2, digits = 3)
an object class 'cmp', obtained from a call to glm.cmp
an object class 'cmp', obtained from a call to glm.cmp
numeric; minimum number of significant digits to be used for most numbers.
Huang, A. (2017). Mean-parametrized Conway-Maxwell-Poisson regression models for dispersed counts. Statistical Modelling 17, 359--380.
## Testing for the mean coefficients
data(takeoverbids)
## Fit full model
M.bids.full <- glm.cmp(numbids ~ leglrest + rearest + finrest + whtknght
+ bidprem + insthold + size + sizesq + regulatn, data = takeoverbids)
## Fit null model; without whtknght
M.bids.null <- update(M.bids.full, . ~ . - whtknght)
## Likelihood ratio test for the nested models
cmplrtest(M.bids.full, M.bids.null) # order of objects is not important
#>
#> Likelihood ratio test for testing both COM-Poisson models are equivalent
#> LRT-statistic: 13.7
#> Chi-sq degrees of freedom: 1
#> P-value: 0.000214
## Testing for dispersion coefficients
data(sitophilus)
M.sit.full <- glm.cmp(formula = ninsect ~ extract, formula_nu = ~extract, data = sitophilus)
## Fit null model; dropping extract from dispersion equation
M.sit.null1 <- update(M.sit.full, formula_nu. = ~1)
cmplrtest(M.sit.null1, M.sit.full)
#>
#> Likelihood ratio test for testing both COM-Poisson models are equivalent
#> LRT-statistic: 0.439
#> Chi-sq degrees of freedom: 3
#> P-value: 0.932
## Fit null model; using constant dispersion specification
M.sit.null2 <- update(M.sit.full, formula_nu. = NULL)
cmplrtest(M.sit.null2, M.sit.full)
#>
#> Likelihood ratio test for testing both COM-Poisson models are equivalent
#> LRT-statistic: 0.439
#> Chi-sq degrees of freedom: 3
#> P-value: 0.932