disptest {countreg} | R Documentation |
Tests the null hypothesis of equidispersion in Poisson GLMs against the alternative of overdispersion and/or underdispersion.
disptest(object, type = c("lrtNB2", "scoreNB2", "scoreNB2adj", "scoreNB1", "scoreNB1adj", "scoreKatz"), trafo = NULL, alternative = c("greater", "two.sided", "less"))
object |
a fitted Poisson GLM of class |
type |
type of test, one of |
trafo |
a specification of the alternative (see also details),
can be numeric or a (positive) function or |
alternative |
a character string specifying the alternative hypothesis:
|
The standard Poisson GLM models the (conditional) mean
E[y] = mu which is assumed to be equal to the
variance VAR[y] = mu. disptest
assesses the hypothesis that this assumption holds (equidispersion) against
the alternative that the variance is of the form:
VAR[y] = mu + alpha * trafo(mu).
Overdispersion corresponds to alpha > 0 and underdispersion to alpha < 0. The coefficient alpha can be estimated by an auxiliary OLS regression and tested with the corresponding t (or z) statistic which is asymptotically standard normal under the null hypothesis.
Common specifications of the transformation function trafo are trafo(mu) = mu^2 or trafo(mu) = mu. The former corresponds to a negative binomial (NB) model with quadratic variance function (called NB2 by Cameron and Trivedi, 2005), the latter to a NB model with linear variance function (called NB1 by Cameron and Trivedi, 2005) or quasi-Poisson model with dispersion parameter, i.e.,
VAR[y] = (1 + alpha) * mu = dispersion * mu.
By default, for trafo = NULL
, the latter dispersion formulation is used in
dispersiontest
. Otherwise, if trafo
is specified, the test is formulated
in terms of the parameter alpha. The transformation trafo
can either
be specified as a function or an integer corresponding to the function function(x) x^trafo
,
such that trafo = 1
and trafo = 2
yield the linear and quadratic formulations
respectively.
Type "lrtNB2"
is the LRT comparing the classical Poisson and negative binomial regression models.
Note that this test has a non-standard null distribution here, since the negative binomial
shape parameter (called theta
in glm.nb
) is on the boundary of the parameter
space under the null hypothesis. Hence the asymptotic distribution of the LRT is that of the arithmetic mean of
a point mass at zero and a chi-square (1) distribution, implying that the p-value is
half that of the classical case.
Type "scoreNB2"
corresponds to the statistic T_1 in Dean and Lawless (1989),
type "scoreNB2adj"
is their T_a. "scoreNB2"
also appears in Lee (1986).
Type "scoreNB1"
corresponds to the statistic P_C in Dean (1992), type "scoreNB1adj"
is her P'_C.
Type "scoreKatz"
is the score test against Katz alternatives derived by Lee (1986),
these distributions permit overdispersion as well as underdispersion.
The score tests against NB1 and NB2 alternatives are also the score tests against
Generalized Poisson type 1 and type 2 alternatives (Yang, Hardin, and Addy, 2009).
An object of class "htest"
.
Cameron AC, Trivedi PK (1990). “Regression-based Tests for Overdispersion in the Poisson Model”. Journal of Econometrics, 46, 347–364.
Cameron AC, Trivedi PK (2005). Microeconometrics: Methods and Applications. Cambridge: Cambridge University Press.
Cameron AC, Trivedi PK (2013). Regression Analysis of Count Data, 2nd ed. Cambridge: Cambridge University Press.
Dean CB (1992). “Testing for Overdispersion in Poisson and Binomial Regression Models”. Journal of the American Statistical Association, 87, 451–457.
Dean C, Lawless JF (1989). “Tests for Detecting Overdispersion in Poisson Regression Models”. Journal of the American Statistical Association, 84, 467–472.
Jaggia S, Thosar S (1993). “Multiple Bids as a Consequence of Target Management Resistance: A Count Data Approach”. Review of Quantitative Finance and Accounting, 3, 447–457.
Lee LF (1986). “Specification Test for Poisson Regression Models”. International Economic Review, 27, 689–706.
Yang Z, Hardin JW, Addy CL (2009). “A Note on Dean's Overdispersion Test”. Journal of Statistical Planning and Inference, 139 (10), 3675–3678.
## Data with overdispersion data("RecreationDemand", package = "AER") rd_p <- glm(trips ~ ., data = RecreationDemand, family = poisson) ## Cameron and Trivedi (2013), p. 248 disptest(rd_p, type = "lrtNB2", alternative = "greater") ## Data with underdispersion data("TakeoverBids", package = "countreg") tb_p <- glm(bids ~ . + I(size^2), data = TakeoverBids, family = poisson) ## Jaggia and Thosar (1993), Table 3 ## testing overdispersion disptest(tb_p, type = "scoreNB2", alternative = "greater") disptest(tb_p, type = "scoreNB2adj", alternative = "greater") ## testing underdispersion disptest(tb_p, type = "scoreKatz", alternative = "two.sided")