Tests the null hypothesis of equidispersion in Poisson GLMs against the alternative of overdispersion and/or underdispersion.
Usage
disptest(object,
type = c("lrtNB2", "scoreNB2", "scoreNB2adj", "scoreNB1", "scoreNB1adj", "scoreKatz"),
trafo = NULL, alternative = c("greater", "two.sided", "less"))
Arguments
object
a fitted Poisson GLM of class “glm” as fitted by glm with family poisson.
type
type of test, one of lrtNB2, scoreNB2, scoreNB2adj, scoreNB1, scoreNB1adj, scoreKatz. See details.
trafo
a specification of the alternative (see also details), can be numeric or a (positive) function or NULL (the default).
alternative
a character string specifying the alternative hypothesis: “greater” corresponds to overdispersion, “less” to underdispersion and “two.sided” to either one.
Details
The standard Poisson GLM models the (conditional) mean \(\mathsf{E}[y] = \mu\) which is assumed to be equal to the variance \(\mathsf{VAR}[y] = \mu\). disptest assesses the hypothesis that this assumption holds (equidispersion) against the alternative that the variance is of the form:
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 \(\mathrm{trafo}\) are \(\mathrm{trafo}(\mu) = \mu^2\) or \(\mathrm{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.,
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^2_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).
Value
An object of class “htest”.
References
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.
See Also
glm, poisson, glm.nb
Examples
library("countreg")## Data with overdispersiondata("RecreationDemand", package ="AER")rd_p<-glm(trips~., data =RecreationDemand, family =poisson)## Cameron and Trivedi (2013), p. 248disptest(rd_p, type ="lrtNB2", alternative ="greater")
Overdispersion test
data: rd_p
z = 1407.7, p-value < 2.2e-16
alternative hypothesis: greater
## Data with underdispersiondata("TakeoverBids", package ="countreg")tb_p<-glm(bids~.+I(size^2), data =TakeoverBids, family =poisson)## Jaggia and Thosar (1993), Table 3## testing overdispersiondisptest(tb_p, type ="scoreNB2", alternative ="greater")
Overdispersion test
data: tb_p
z = -1.0173, p-value = 0.8455
alternative hypothesis: greater
disptest(tb_p, type ="scoreNB2adj", alternative ="greater")
Overdispersion test
data: tb_p
z = -0.29924, p-value = 0.6176
alternative hypothesis: greater
## testing underdispersiondisptest(tb_p, type ="scoreKatz", alternative ="two.sided")
Dispersion test
data: tb_p
z = -2.5206, p-value = 0.01172
alternative hypothesis: two.sided