01 / 21

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.

Statistics Graduate Level

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.

Discrete
Only whole numbers: \(Y \in \{0, 1, 2, \ldots\}\)
Non-negative
Counts cannot drop below zero
Often skewed
Many zeros and a long right tail

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).

y (count) P(Y = y) 0 1 2 3 4 5 6 7 8 9 10
\(\lambda = 2\)
\(\lambda = 5\)

Why Not OLS for Counts?

Linear regression (\(Y = \beta_0 + \beta_1 X + \varepsilon\)) makes three assumptions that fail for count data:

1
Normality: Counts are discrete and right-skewed, not Gaussian.
2
Constant variance: For Poisson data, variance grows with the mean, violating homoscedasticity.
3
Linearity of response: OLS can predict \(\hat{Y} < 0\), which is nonsensical for counts.

The Poisson Regression Model

Poisson regression is a generalized linear model (GLM) with three components:

Random
\(Y_i \sim \text{Poisson}(\lambda_i)\)
Systematic
\(\eta_i = \beta_0 + \beta_1 x_{i1} + \cdots + \beta_p x_{ip}\)
Link
\(\ln(\lambda_i) = \eta_i\) (canonical log link)

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.

X (predictor)
\(\lambda = E[Y]\)
OLS (linear) Poisson (exp) 0 2 4 6 8 0 5 10 15 20 ← OLS can go negative here

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:

\(e^{\beta_1} = 1.20\)
The expected count increases by 20% per unit of \(x\)
\(e^{\beta_1} = 0.85\)
The expected count decreases by 15% per unit of \(x\)

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:

1
Initialize \(\boldsymbol{\beta}^{(0)}\) (often from OLS on \(\ln(Y+1)\)).
2
Compute working weights \(W = \text{diag}(\lambda_i)\) and working response \(z_i\).
3
Update \(\boldsymbol{\beta}^{(t+1)} = (\mathbf{X}^{\top}W\mathbf{X})^{-1}\mathbf{X}^{\top}W\mathbf{z}\).
4
Iterate until \(\|\boldsymbol{\beta}^{(t+1)} - \boldsymbol{\beta}^{(t)}\|\) converges.

How to Apply Poisson Regression

1
Verify count data: Response \(Y\) must be non-negative integers.
2
Check mean-variance relationship: Compute sample mean and variance of \(Y\). If they are approximately equal, Poisson is reasonable.
3
Fit the model: Use software (R: glm(Y ~ X, family=poisson); Python: sm.GLM(..., family=Poisson())).
4
Interpret coefficients: Exponentiate \(\hat{\beta}\) to get rate ratios \(e^{\hat{\beta}}\).
5
Assess goodness-of-fit: Check deviance residuals, Pearson \(\chi^2/df\), and residual plots for overdispersion.
6
Consider offsets: If exposure varies (e.g., different time periods), include \(\ln(t_i)\) as an offset.

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\))?

1
Plug in: \(\ln(\hat{\lambda}) = 0.50 + 0.30(5) = 2.00\)
2
Exponentiate: \(\hat{\lambda} = e^{2.00} \approx 7.39\)
3
Interpret: A 50-year-old is expected to make about 7.4 visits per year.

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:

\(e^{0.015} \approx 1.015\)
Each extra unit/hr of speed increases defects by 1.5%
\(e^{-0.10} \approx 0.905\)
Each extra year of experience reduces defects by 9.5%

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.

Hospital A
12 infections over 500 patient-days: rate = 0.024/day
Hospital B
8 infections over 200 patient-days: rate = 0.040/day

Model Diagnostics

After fitting, check whether the Poisson assumptions hold:

\(\text{Deviance} / df\)
Should be \(\approx 1\). Values \(\gg 1\) signal overdispersion.
Residual plots
Deviance residuals vs. fitted values: look for patterns or funneling.
\(\text{Pearson } \chi^2\)
\(\sum (y_i - \hat{\lambda}_i)^2 / \hat{\lambda}_i\). Compare to \(\chi^2_{n-p}\).

Common Mistakes

✕ Ignoring overdispersion
Using Poisson when \(\text{Var}(Y) \gg E[Y]\) leads to artificially small standard errors and false significance.
✕ Interpreting \(\beta\) additively
Saying "\(\beta_1 = 0.30\) means 0.30 more visits" is wrong. It means the log-count increases by 0.30, i.e. counts are multiplied by \(e^{0.30}\).
✕ Forgetting the offset
Comparing raw counts when exposure times differ biases results. Always include an offset for unequal windows.

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\)?