The Poisson regression model can be generalized by introducing an unobserved heterogeneity term for observation . Thus, the individuals are assumed to differ randomly in a manner that is not fully accounted for by the observed covariates. This is formulated as
where the unobserved heterogeneity term is independent of the vector of regressors . Then the distribution of conditional on and is Poisson with conditional mean and conditional variance :
Let be the probability density function of . Then, the distribution (no longer conditional on ) is obtained by integrating with respect to :
An analytical solution to this integral exists when is assumed to follow a gamma distribution. This solution is the negative binomial distribution. If the model contains a constant term, then in order to identify the mean of the distribution, it is necessary to assume that . Thus, it is assumed that follows a gamma() distribution with and ,
where is the gamma function and is a positive parameter. Then, the density of given is derived as
|
|
|
|
|
|
|
|
|
|
|
|
If you make the substitution (), the negative binomial distribution can then be rewritten as
Thus, the negative binomial distribution is derived as a gamma mixture of Poisson random variables. It has the conditional mean
and the conditional variance
The conditional variance of the negative binomial distribution exceeds the conditional mean. Overdispersion results from neglected unobserved heterogeneity. The negative binomial model with variance function , which is quadratic in the mean, is referred to as the NEGBIN2 model (Cameron and Trivedi 1986). To estimate this model, specify DIST=NEGBIN(P=2) in the MODEL statement. The Poisson distribution is a special case of the negative binomial distribution where . A test of the Poisson distribution can be carried out by testing the hypothesis that . A Wald test of this hypothesis is provided (it is the reported statistic for the estimated in the negative binomial model).
The log-likelihood function of the negative binomial regression model (NEGBIN2) is given by
|
|
|
|
|
|
where use of the following fact is made if is an integer:
The gradient is
and
Cameron and Trivedi (1986) consider a general class of negative binomial models that have mean and variance function . The NEGBIN2 model, with , is the standard formulation of the negative binomial model. Models that have other values of , , have the same density , except that is replaced everywhere by . The negative binomial model NEGBIN1, which sets , has the variance function , which is linear in the mean. To estimate this model, specify DIST=NEGBIN(P=1) in the MODEL statement.
The log-likelihood function of the NEGBIN1 regression model is given by
|
|
|
|
|
|
The gradient is
and