odTest(glmobj, alpha=.05, digits = max(3, getOption("digits") - 3))
negbin
produced by
glm.nb
theta
in glm.nb
) is
restricted to be positive. The asymptotic distribution of the LR
(likelihood ratio) 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 $\alpha$ = .05
level, one should not reject the null unless the LR test statistic
exceeds the critical value associated with the $2\alpha$
= .10 level; this LR test involves just one parameter restriction, so
the critical value of the test statistic at the $p$ = .05 level
is 2.7, instead of the usual 3.8 (i.e., the .90 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.
Lawless, J. F. (1987) "Negative Binomial and Mixed Poisson Regressions." The Canadian Journal of Statistics. 15:209-225.
glm.nb
, logLik
data(bioChemists)
require(MASS)
modelnb <- glm.nb(art ~ .,
data=bioChemists,
trace=TRUE)
odTest(modelnb)
Run the code above in your browser using DataLab