In statistics, Poisson regression is a generalized linear model form of regression analysis used to model count data and contingency tables.[1] Poisson regression assumes the response variable Y has a Poisson distribution, and assumes the logarithm of its expected value can be modeled by a linear combination of unknown parameters. A Poisson regression model is sometimes known as a log-linear model, especially when used to model contingency tables.
Negative binomial regression is a popular generalization of Poisson regression because it loosens the highly restrictive assumption that the variance is equal to the mean made by the Poisson model. The traditional negative binomial regression model is based on the Poisson-gamma mixture distribution. This model is popular because it models the Poisson heterogeneity with a gamma distribution.
Poisson regression models are generalized linear models with the logarithm as the (canonical) link function, and the Poisson distribution function as the assumed probability distribution of the response.
If
x\inRn
log(\operatorname{E}(Y\midx))=\alpha+\beta'x,
where
\alpha\inR
\beta\inRn
log(\operatorname{E}(Y\midx))=\boldsymbol{\theta}'x,
where
x
\theta
\beta
\alpha
Thus, when given a Poisson regression model
\theta
x
\operatorname{E}(Y\midx)=e\boldsymbol{\theta'x
If
Yi
xi
\theta
Suppose we have a model with a single predictor, that is,
n=1
log(\operatorname{E}(Y\midx))=\alpha+\betax
Suppose we compute the predicted values at point
(Y2,x2)
(Y1,x1)
log(\operatorname{E}(Y2\midx2))=\alpha+\betax2
log(\operatorname{E}(Y1\midx1))=\alpha+\betax1
By substracting the first from the second:
log(\operatorname{E}(Y2\midx2))-log(\operatorname{E}(Y1\midx1))=\beta(x2-x1)
Suppose now that
x2=x1+1
log(\operatorname{E}(Y2\midx2))-log(\operatorname{E}(Y1\midx1))=\beta
So the coefficient of the model is to be interpreted as the increase in the logarithm of the count of the outcome variable when the independent variable increases by 1.
By applying the rules of logarithms:
log\left(\dfrac{\operatorname{E}(Y2\midx2)}{\operatorname{E}(Y1\midx1)}\right)=\beta
\dfrac{\operatorname{E}(Y2\midx2)}{\operatorname{E}(Y1\midx1)}=e\beta
\operatorname{E}(Y2\midx2)=e\beta\operatorname{E}(Y1\midx1)
That is, when the independent variable increases by 1, the outcome variable is multiplied by the exponentiated coefficient.
The exponentiated coefficient is also called the incidence ratio.
Often, the object of interest is the average partial effect or average marginal effect
\partialE(Y|x) | |
\partialx |
Y
x
x
\partialE(Y|x) | |
\partialx |
=\exp(\theta'x)\beta
\hat{\theta}=(\hat{\alpha},\hat{\beta})
x
Given a set of parameters θ and an input vector x, the mean of the predicted Poisson distribution, as stated above, is given by
λ:=\operatorname{E}(Y\midx)=e\theta'x,
and thus, the Poisson distribution's probability mass function is given by
p(y\midx;\theta)=
λy | |
y! |
e-λ=
| |||||||||||
y! |
Now suppose we are given a data set consisting of m vectors
xi\inRn+1,i=1,\ldots,m
y1,\ldots,ym\inN
p(y1,\ldots,ym\midx1,\ldots,xm;\theta)=
m | |
\prod | |
i=1 |
| |||||||||||||||
yi! |
.
By the method of maximum likelihood, we wish to find the set of parameters θ that makes this probability as large as possible. To do this, the equation is first rewritten as a likelihood function in terms of θ:
L(\theta\midX,Y)=
m | |
\prod | |
i=1 |
| |||||||||||||||
yi! |
.
Note that the expression on the right hand side has not actually changed. A formula in this form is typically difficult to work with; instead, one uses the log-likelihood:
\ell(\theta\midX,Y)=logL(\theta\midX,Y)=
m | |
\sum | |
i=1 |
\left(yi\theta'xi-
\theta'xi | |
e |
-log(yi!)\right).
Notice that the parameters θ only appear in the first two terms of each term in the summation. Therefore, given that we are only interested in finding the best value for θ we may drop the yi! and simply write
\ell(\theta\midX,Y)=
m | |
\sum | |
i=1 |
\left(yi\theta'xi-
\theta'xi | |
e |
\right).
To find a maximum, we need to solve an equation
\partial\ell(\theta\midX,Y) | |
\partial\theta |
=0
-\ell(\theta\midX,Y)
Poisson regression may be appropriate when the dependent variable is a count, for instance of events such as the arrival of a telephone call at a call centre.[3] The events must be independent in the sense that the arrival of one call will not make another more or less likely, but the probability per unit time of events is understood to be related to covariates such as time of day.
Poisson regression may also be appropriate for rate data, where the rate is a count of events divided by some measure of that unit's exposure (a particular unit of observation).[4] For example, biologists may count the number of tree species in a forest: events would be tree observations, exposure would be unit area, and rate would be the number of species per unit area. Demographers may model death rates in geographic areas as the count of deaths divided by person−years. More generally, event rates can be calculated as events per unit time, which allows the observation window to vary for each unit. In these examples, exposure is respectively unit area, person−years and unit time. In Poisson regression this is handled as an offset. If the rate is count/exposure, multiplying both sides of the equation by exposure moves it to the right side of the equation. When both sides of the equation are then logged, the final model contains log(exposure) as a term that is added to the regression coefficients. This logged variable, log(exposure), is called the offset variable and enters on the right-hand side of the equation with a parameter estimate (for log(exposure)) constrained to 1.
log(\operatorname{E}(Y\midx))=\theta'x
log\left( | \operatorname{E |
(Y\mid |
x)}{exposure
Offset in the case of a GLM in R can be achieved using the offset
function:
A characteristic of the Poisson distribution is that its mean is equal to its variance. In certain circumstances, it will be found that the observed variance is greater than the mean; this is known as overdispersion and indicates that the model is not appropriate. A common reason is the omission of relevant explanatory variables, or dependent observations. Under some circumstances, the problem of overdispersion can be solved by using quasi-likelihood estimation or a negative binomial distribution instead.[5] [6]
Ver Hoef and Boveng described the difference between quasi-Poisson (also called overdispersion with quasi-likelihood) and negative binomial (equivalent to gamma-Poisson) as follows: If E(Y) = μ, the quasi-Poisson model assumes var(Y) = θμ while the gamma-Poisson assumes var(Y) = μ(1 + κμ), where θ is the quasi-Poisson overdispersion parameter, and κ is the shape parameter of the negative binomial distribution. For both models, parameters are estimated using iteratively reweighted least squares. For quasi-Poisson, the weights are μ/θ. For negative binomial, the weights are μ/(1 + κμ). With large μ and substantial extra-Poisson variation, the negative binomial weights are capped at 1/κ. Ver Hoef and Boveng discussed an example where they selected between the two by plotting mean squared residuals vs. the mean.[7]
Another common problem with Poisson regression is excess zeros: if there are two processes at work, one determining whether there are zero events or any events, and a Poisson process determining how many events there are, there will be more zeros than a Poisson regression would predict. An example would be the distribution of cigarettes smoked in an hour by members of a group where some individuals are non-smokers.
Other generalized linear models such as the negative binomial model or zero-inflated model may function better in these cases.
On the contrary, underdispersion may pose an issue for parameter estimation.[8]
Poisson regression creates proportional hazards models, one class of survival analysis: see proportional hazards models for descriptions of Cox models.
When estimating the parameters for Poisson regression, one typically tries to find values for θ that maximize the likelihood of an expression of the form
m | |
\sum | |
i=1 |
\theta'xi | |
log(p(y | |
i;e |
)),
where m is the number of examples in the data set, and
\theta'xi | |
p(y | |
i;e |
)
\theta'xi | |
e |
m | |
\sum | |
i=1 |
\theta'xi | |
log(p(y | |
i;e |
))-λ
2, | |
\left\|\theta\right\| | |
2 |
for some positive constant
λ