Learn R Programming

pscl (version 0.5)

odTest: Likelihood ratio test for over-dispersion in count data

Description

Compares the log-likelihoods of a negative binomial regression model and a Poisson regression model

Usage

odTest(glmobj, digits = max(3, getOption("digits") - 3))

Arguments

glmobj
an object of class negbin produced by glm.nb
digits
number of digits in printed output

Value

  • None; prints results and returns silently

Details

The negative binomial model relaxes the assumption in the Poisson model that the (conditional) variance equals the (conditional) mean, by estimating one extra parameter. A likelihood ratio (LR) test can be used to test the null hypothesis that the restriction implicit in the Poisson model is true. The LR test-statistic has a non-standard distribution, even asymptotically, since the negative binomial over-dispersion parameter (called theta in glm.nb) is restricted to be positive. The asymptotic distribution of the LR test-statistic has probability mass of one half at zero, and a half $\chi^2_1$ distribution above zero. This means that if testing at the $p$ = .05 level, we should not reject the null unless the LR test-statistic exceeds the critical value associated with the $p$ = .025 level; this LR test involves just one parameter restriction, so the critical value of the test statistic at the $p$ = .05 test statistic is 5.02, instead of the usual 3.8 (i.e., the .975 quantile of the $\chi^2_1$ distribution, versus the .95 quantile).

A Poisson model is run using glm with family set to link{poisson}, using the formula in the negbin model object passed as input. The logLik functions are used to extract the log-likelihood for each model.

References

A. Colin Cameron and Pravin K. Trivedi (1998) Regression analysis of count data. New York: Cambridge University Press.

See Also

glm.nb, logLik

Examples

Run this code
data(bioChemists)
require(MASS)
modelnb <- glm.nb(art ~ .,
                 data=bioChemists,
                 trace=TRUE)
odTest(modelnb)

Run the code above in your browser using DataLab