Poisson and negative binomial regression
Counts (hospital visits, defects, days absent, species observed) are whole numbers that can’t be negative, and they’re often skewed. Linear regression handles them badly. Count models, built on the Poisson distribution, are designed for them.
The model and incidence rate ratios
log(expected count) = b₀ + b₁x₁ + b₂x₂ + …
Exponentiating a coefficient gives an incidence rate ratio: the factor by which the expected count multiplies per unit increase in the predictor. IRR = 1.5 means 50% more events, and IRR = 0.8 means 20% fewer.
Worked example: yarn breaks during weaving
R’s warpbreaks data count yarn breaks on 54 looms, by wool type (A or B) and tension (low, medium, high). The reference levels are wool A and high tension.
Step 1: Poisson regression, then a problem
The Poisson model suggests clear effects: wool B IRR = 0.81 (95% CI 0.74 to 0.90), low tension IRR = 1.68 (1.48 to 1.90), medium tension 1.22 (1.07 to 1.39), all p < .01. But the Pearson dispersion statistic is 4.26, where a Poisson model expects about 1. The counts vary four times more than the model allows, so its standard errors are far too small. Analytika prints a caveat saying exactly this.
Step 2: negative binomial regression
| Predictor (vs reference) | IRR | 95% CI | p |
|---|---|---|---|
| Wool B (vs A) | 0.83 | [0.68, 1.01] | .065 |
| Low tension (vs high) | 1.67 | [1.31, 2.13] | < .001 |
| Medium tension (vs high) | 1.24 | [0.97, 1.58] | .092 |
The estimates barely change, but the intervals widen. The wool and medium-tension effects are no longer significant. Only low tension (about 67% more breaks than high tension) survives. The negative binomial model also fits far better: AIC 408.8 vs 493.1 (see model selection with AIC). Both models match R’s glm() and MASS::glm.nb().
APA write-up
Because the Poisson model was overdispersed (dispersion = 4.26), a negative binomial regression was used. Low tension was associated with more breaks than high tension, IRR = 1.67, 95% CI [1.31, 2.13], p < .001. There was no evidence of a difference between wool types, IRR = 0.83, 95% CI [0.68, 1.01], p = .065.
Other things to check
- Exposure: if counts come from different time periods or population sizes, include the log of exposure as an offset, so you model rates.
- Excess zeros: many more zeros than expected call for zero-inflated or hurdle models.
- Independence: repeated counts from the same unit need mixed or clustered models.
How to run it
- SPSS: Analyze → Generalized Linear Models, then choose Poisson log-linear or Negative binomial with log link.
- R:
glm(y ~ x, family = poisson)orMASS::glm.nb(y ~ x) - Analytika: fits a count model for count outcomes, reports IRRs, and flags overdispersion. See regression analysis.
More in Regression
Run this on your own data
Upload a dataset and ask your question in plain English. Analytika checks the assumptions, picks the test, runs it, and writes the results up in APA format.