cmplrtest: Likelihood Ratio Test for nested COM-Poisson models

Description Usage Arguments References See Also Examples

View source: R/Inference.R

Description

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.

Usage

1
cmplrtest(object1, object2, digits = 3)

Arguments

object1

an object class 'cmp', obtained from a call to glm.cmp

object2

an object class 'cmp', obtained from a call to glm.cmp

digits

numeric; minimum number of significant digits to be used for most numbers.

References

Huang, A. (2017). Mean-parametrized Conway-Maxwell-Poisson regression models for dispersed counts. Statistical Modelling 17, 359–380.

See Also

glm.cmp, update.cmp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## 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

## 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)

## Fit null model; using constant dispersion specification
M.sit.null2 <- update(M.sit.full, formula_nu. = NULL)   
cmplrtest(M.sit.null2, M.sit.full)

mpcmp documentation built on Oct. 26, 2020, 9:07 a.m.