Poisson
Regression
Learn how to model count data using the Poisson distribution as the foundation for a generalized linear model: from the log-link function to interpreting rate ratios.
What Is Count Data?
Many real-world outcomes are non-negative integers: the number of emergency room visits per month, the number of goals in a soccer match, or the number of defects on a manufactured part. These are count data: they can be 0, 1, 2, 3, ... but never negative or fractional.
The Poisson Distribution
The Poisson distribution models the probability of observing \(y\) events in a fixed interval, governed by a single parameter \(\lambda > 0\) (the rate).
Why Not OLS for Counts?
Linear regression (\(Y = \beta_0 + \beta_1 X + \varepsilon\)) makes three assumptions that fail for count data:
The Poisson Regression Model
Poisson regression is a generalized linear model (GLM) with three components:
The Log Link Visualized
The log link maps a linear predictor \(\eta \in (-\infty, +\infty)\) to a positive mean \(\lambda = e^{\eta} > 0\). The relationship between \(X\) and \(\lambda\) is exponential.
Interpreting Coefficients
Since \(\ln(\lambda) = \beta_0 + \beta_1 x\), a one-unit increase in \(x\) changes the log-mean by \(\beta_1\). On the original count scale:
Poisson vs. Negative Binomial
The Poisson model assumes equidispersion: \(\text{Var}(Y) = E[Y]\). Real count data often exhibit overdispersion: \(\text{Var}(Y) > E[Y]\). The Negative Binomial adds a dispersion parameter \(\alpha\).
| Poisson | Negative Binomial | |
|---|---|---|
| Variance | \(\text{Var} = \lambda\) | \(\text{Var} = \lambda + \alpha\lambda^2\) |
| Dispersion | Fixed (equidispersion) | Estimated from data |
| When to use | \(\text{Mean} \approx \text{Variance}\) | \(\text{Variance} \gg \text{Mean}\) |
| Link | Log | Log |
| Extra parameter | None | \(\alpha\) (shape) |
Maximum Likelihood Estimation
Parameters \(\boldsymbol{\beta}\) are estimated by maximizing the log-likelihood:
How to Apply Poisson Regression
glm(Y ~ X, family=poisson); Python: sm.GLM(..., family=Poisson())).Example 1: Doctor Visits
A health study records the number of doctor visits (\(Y\)) for 200 patients, with predictor \(X\) = age in decades. The fitted model is:
Question: What is the expected number of visits for a 50-year-old (\(X = 5\))?
Example 2: Manufacturing Defects
A factory records defects per batch (\(Y\)) with two predictors: machine speed \(X_1\) (units/hr) and inspector experience \(X_2\) (years). The fitted model is:
Prediction: For \(X_1 = 100\) and \(X_2 = 5\): \(\hat{\lambda} = e^{1.20 + 0.015(100) - 0.10(5)} = e^{2.20} \approx\) 9.03 defects per batch.
Example 3: Offsets for Rates
When observation windows differ (e.g., hospitals observed for different numbers of months), we model the rate rather than the raw count. An offset adjusts for unequal exposure:
Here \(t_i\) is the exposure (person-years, time at risk, area, etc.). The term \(\ln(t_i)\) enters as an offset with coefficient fixed at 1.
Model Diagnostics
After fitting, check whether the Poisson assumptions hold:
Common Mistakes
Summary of Count Models
| Poisson | Quasi-Poisson | Neg. Binomial | |
|---|---|---|---|
| Variance | \(\lambda\) | \(\phi \lambda\) | \(\lambda + \alpha\lambda^2\) |
| Extra params | 0 | \(\phi\) (dispersion) | \(\alpha\) (shape) |
| Link | Log | Log | Log |
| Estimation | MLE | Quasi-MLE | MLE |
| AIC available | Yes | No | Yes |
| Use when | \(\text{Mean} \approx \text{Var}\) | Mild overdispersion | Strong overdispersion |
Question 1 of 5
In Poisson regression, what is the canonical link function?
Question 2 of 5
If \(\hat{\beta}_1 = 0.50\) in a Poisson regression, what is the rate ratio for a one-unit increase in \(X_1\)?
Question 3 of 5
A key assumption of the Poisson distribution is that the mean equals the variance. When the observed variance is much larger than the mean, this is called:
Question 4 of 5
A researcher models hospital infections with \(\ln(\hat{\lambda}_i) = \ln(t_i) + 2.1 - 0.4\,X_i\). What is the role of \(\ln(t_i)\)?
Question 5 of 5
Given the Poisson model \(\ln(\hat{\lambda}) = 1.0 + 0.20\,X\), what is the expected count when \(X = 3\)?