Chapter 11 · Regression models
How do you model counts and rates?
Poisson regression, incidence rate ratios, overdispersion and log-linear models for multi-way tables.
Read first: Risk and survival, Choosing a test
The problem first
You are a DM Neurology resident. Your thesis compares an add-on antiepileptic drug with standard treatment in 120 patients with drug-resistant epilepsy. Seizure diaries were kept for 3 to 6 months, depending on when each patient was recruited.
You entered the total seizure count as the outcome in a Poisson regression and wrote: “The add-on drug reduced seizures (rate ratio 0.78, 95% CI 0.68 to 0.89, p < 0.001).” Your guide looks at the seizure counts column and asks two questions.
“Your patients were followed for 3 to 6 months, and one of them had 52 seizures. What did your analysis do about each of those?”
Start here
What makes a count different from a measurement?
A count is the number of times something happened: seizures in a month, infections in an ICU, admissions in a year. It can only be 0, 1, 2 and so on. It cannot be negative, and when the average is small most values pile up near 0.
Three features of counts cause problems for the t-test and linear regression. The distribution is skewed when the mean is low. The variance rises with the mean, so groups with more events vary more. And the count depends on how long, or how many people, you watched: a patient followed for 6 months has more chance to record seizures than a patient followed for 3.
The Poisson distribution
When does a count follow a Poisson distribution?
When there are many opportunities for an event, each with a small probability, the events happen independently of each other, and the underlying rate stays the same, the number of events follows a Poisson distribution.
P(k events) = e−μ × μk ÷ k!
- k
- number of events: 0, 1, 2, …
- μ
- mean number of events in the interval (in the figure, 2 deaths a year)
- k!
- k factorial: 1 × 2 × … × k, with 0! = 1
- mean = variance
- both equal μ, so the SD is √μ
Worked example
With a mean of 2 events a year:
- P(0) = e−2 = 0.1353. In about 14 years out of 100 there would be no such death.
- P(1) = e−2 × 2 ÷ 1 = 0.2707. P(2) = e−2 × 4 ÷ 2 = 0.2707.
- P(5 or more) = 1 − [P(0) + P(1) + P(2) + P(3) + P(4)] = 1 − 0.9473 = 0.0527.
Uses of the Poisson distribution
- Rare events in large populations: cases of a disease per year in a district, deaths per 1,000 person-years.
- Counting in the laboratory and in nuclear medicine: counts from radioactive decay, colonies on a plate, cells in a counting chamber. The SD of a count N is √N. 10,000 counts have an SD of 100 (1%), and 100 counts an SD of 10 (10%).
- Checking whether events cluster: if events occur more in bunches than a Poisson distribution predicts, the variance will be larger than the mean.
- Poisson regression: modelling counts and rates with several predictors, described below.
For a large mean the Poisson distribution becomes close to a normal distribution with mean μ and SD √μ. With μ = 16, the exact P(10 or fewer) is 0.0774 and the normal approximation with continuity correction gives 0.0846.
Interactive
Change the average seizure count and watch the Poisson probabilities and the variance change
In a Poisson distribution the variance equals the mean, so the spread rises as the mean rises.
Try this: move the average from 2 to 8 seizures a month. The bars spread out and become more symmetric, and the variance rises with the mean, because in a Poisson distribution the two are always equal.
Teaching example: seizures per month in patients who all have the same underlying seizure rate. Made-up numbers.
Mean and variance are both μ
Bars from this count upwards are red
Mean 2.0, variance 2.0, SD 1.41. In the sample of 100 patients: mean 2.06, variance 1.96, variance ÷ mean 0.95.
Rates and the offset
Why compare events per person-time and not the counts?
A count depends on how long, and on how many people, you observed. A rate divides the count by the time at risk: infections per 1,000 catheter-days, deaths per 1,000 person-years, seizures per patient-month.
Poisson regression with an offset
Poisson regression models the logarithm of the expected count. To model a rate, the logarithm of each unit's time at risk is added to the model with its coefficient fixed at 1. This term is the offset. The SPSS manual describes it as a “structural” predictor whose coefficient is not estimated but assumed to be 1.
ln(expected count) = ln(time at risk) + b₀ + b₁x₁ + … + bₖxₖ
which is the same as ln(expected count ÷ time at risk) = b₀ + b₁x₁ + … + bₖxₖ
- ln(time at risk)
- the offset: catheter-days, person-years, months of follow-up, population × years
- eb₀
- the rate when every predictor is 0
- ebᵢ
- the incidence rate ratio (IRR) for a 1-unit rise in xᵢ, adjusted for the other predictors
Worked example: two ICUs
IRR = (18 ÷ 3,600) ÷ (9 ÷ 1,200) = 5.0 ÷ 7.5 = 0.67
SE of ln IRR = √(1/18 + 1/9) = 0.408 95% CI = eln 0.667 ± 1.96 × 0.408 = 0.30 to 1.48
p = 0.32. A Poisson regression with ICU as the only predictor and ln(catheter-days) as the offset gives the same IRR, confidence interval and p-value. Without the offset, the ratio of counts (2.0) would point the wrong way.
Incidence, prevalence and person-time are introduced in the risk and survival chapter.
Interactive
Change infections and catheter-days and watch the counts and the rates disagree
The incidence rate ratio uses the time at risk. Its confidence interval depends on the number of events.
Try this: press "Ten times the data". The rates and the rate ratio stay the same, but the confidence interval becomes much narrower, because precision depends on the number of infections, not on the rate.
Made-up teaching numbers. The ICU example from this chapter.
ICU A: 5.00 infections per 1,000 catheter-days. ICU B: 7.50. IRR 0.67 (95% CI 0.30 to 1.48), p = 0.321. The interval includes 1, so these data are compatible with equal rates.
Reading the output
How do you read an incidence rate ratio?
An incidence rate ratio compares event rates. An IRR of 0.78 means the rate in one group is 78% of the rate in the reference group, a 22% lower rate, after adjusting for the other predictors.
- Per category: each category is compared with the reference category, as in logistic regression.
- Per unit: for a continuous predictor the IRR is per 1-unit rise. For k units use ek × b.
- Rate, not risk: the IRR compares events per unit of time. It allows for repeated events in the same patient and for different follow-up.
- Absolute numbers: a ratio does not show how many events are prevented. Give the rates in each group as well, for example seizures per patient-month (STROBE item 16c asks authors to consider translating relative risks into absolute risks).
| Feature | Incidence rate ratio | Risk ratio |
|---|---|---|
| Compares | Events per unit of person-time | Proportion of people with at least one event |
| Repeated events in one patient | All counted | Only the first counts |
| Different follow-up | Allowed for through the offset | Needs equal follow-up, or survival methods |
| Model | Poisson or negative binomial regression | Log-binomial or modified Poisson regression |
| Example | Seizures per patient-month | Proportion of patients with any seizure |
Poisson regression can also estimate risk ratios for a yes/no outcome. Zou (2004) proposed Poisson regression with robust standard errors for prospective studies with binary data, the “modified Poisson” approach, because the usual Poisson standard errors are wrong for a 0/1 outcome. The logistic regression chapter explains when a risk ratio is needed instead of an odds ratio.
Overdispersion
What if the counts vary more than a Poisson distribution allows?
Poisson regression assumes that patients with the same predictor values have the same underlying rate. Real patients differ: some have frequent seizures and some rare ones. Mixing patients with different rates makes the variance larger than the mean. This is overdispersion.
Why it matters
Poisson regression calculates its standard errors from the assumption that variance equals mean. When the variance is larger, the standard errors are too small, the confidence intervals too narrow and the p-values too small. The rate ratio itself is usually estimated reasonably, but its precision is overstated.
How to detect it
- Variance ÷ mean of the counts in each group. In the teaching trial below: 34.4 ÷ 7.6 = 4.5 with standard treatment and 72.6 ÷ 6.17 = 11.8 with the add-on drug. (With unequal follow-up this is only a rough check.)
- Pearson χ² ÷ residual degrees of freedom after fitting Poisson regression. Close to 1 is consistent with a Poisson distribution. The teaching trial gives 813.07 ÷ 118 = 6.89. The deviance ÷ df, 5.48, is a similar check.
- Likelihood ratio test of α = 0: compares the negative binomial model with the Poisson model. Teaching trial: χ² = 332.4, p < 0.001.
- Observed and expected frequencies: compare how many patients had 0, 1, 2 … events with the numbers each model predicts.
The fix: negative binomial regression
Negative binomial regression uses the same log link and offset, and gives incidence rate ratios in the same way. It adds one parameter, α, for the extra variation between patients:
variance = μ + α × μ²
When α = 0 the model is Poisson regression. Two other corrections keep the Poisson estimates but enlarge the standard errors: quasi-Poisson regression, which multiplies them by √(Pearson χ² ÷ df), and robust standard errors. In the teaching trial all three corrections give similar intervals, all wider than the Poisson interval.
| Feature | Poisson regression | Negative binomial regression |
|---|---|---|
| Variance | Equal to the mean | Mean + α × mean² |
| Extra parameter | None | α (SPSS calls it the ancillary parameter; R's MASS::glm.nb estimates θ = 1/α) |
| Suits | Counts from a constant rate: radioactive counts, rare events in large populations | Counts that vary between patients: seizures, exacerbations, days in hospital |
| If overdispersion is present | Standard errors too small, p-values too small | Standard errors allow for it |
| Teaching trial, IRR (95% CI) | 0.78 (0.68 to 0.89), p < 0.001 | 0.78 (0.57 to 1.09), p = 0.14 |
| AIC in the teaching trial | 1041.3 | 710.9 (lower is better) |
Interactive
Increase the extra variation and watch the Poisson confidence intervals stop covering the true rate ratio
A 95% confidence interval should contain the true value in about 95 of 100 studies. With overdispersion, Poisson intervals do so less often.
Try this: start at a variance ÷ mean ratio of 1, where both methods give 95% intervals that contain the true rate ratio in about 95 of 100 trials. Move the ratio to 4 and watch the Poisson coverage fall while the negative binomial coverage stays close to 95%.
Made-up trials: control patients average 3 seizures during follow-up, and the new drug truly lowers the rate by 25% (true rate ratio 0.75). Each setting runs 200 trials.
1 = Poisson; above 1 = overdispersion
30, 60 or 120
Across the trials the estimated ln(rate ratio) actually varied with SD 0.110. Poisson regression reported an average standard error of 0.114; negative binomial regression reported 0.117 (average estimated α 0.02). Both standard errors are close to the actual variation.
Zeros
What if there are more zeros than the model expects?
Sometimes the zeros come from two sources. Some people cannot have the event at all, such as non-smokers when the outcome is cigarettes smoked. Others could have it but did not, by chance. A zero-inflated model treats these two sources separately.
- Zero-inflated model: Lambert (1992) described zero-inflated Poisson regression: with probability p the only possible observation is 0, and with probability 1 − p a Poisson count is observed. Both parts can depend on predictors. A zero-inflated negative binomial model uses a negative binomial count part.
- Hurdle model: one part models whether the count is zero or not, and a second part models the size of the count among those above zero.
- Check the negative binomial model first. Many zeros are not the same as excess zeros. In the seizure trial the negative binomial model predicts 10.0 patients with no seizures against 9 observed, so no zero-inflated model is needed.
- Choose a zero-inflated model only when there is a clinical reason for a group that cannot have the event.
Multi-way tables
How do you analyse a table with three categorical variables?
A log-linear model is Poisson regression applied to the cell counts of a contingency table. There is no single outcome variable. The interaction terms describe which variables are associated.
The models, from simplest to saturated
Write hospital as H, technique as T and infection as O. The notation lists the highest interactions included: [HT][HO] means the model contains H, T, O, the H × T term and the H × O term.
| Model | What it says | G² | df | p |
|---|---|---|---|---|
| [H][T][O] | Mutual independence: no two variables are associated | 129.16 | 4 | < 0.001 |
| [HT][O] | Infection is independent of hospital and technique together | 24.51 | 3 | < 0.001 |
| [HT][HO] | Conditional independence: technique and infection are independent within each hospital | 0.15 | 2 | 0.93 |
| [HT][HO][TO] | Homogeneous association: the technique–infection odds ratio is the same in both hospitals | 0.10 | 1 | 0.76 |
| [HTO] | Saturated: fits every cell exactly | 0 | 0 | — |
G² (the deviance) compares each model's expected counts with the observed counts. A small G² with a large p-value means the model fits. The conditional independence model [HT][HO] fits, and adding the T × O term improves G² by only 0.05 (p = 0.82). The technique–infection association in the pooled table (G² = 6.89, 1 df, p = 0.009) disappears once hospital is in the model.
ln(expected count) = λ + λH + λT + λO + λHT + λHO
| Feature | Log-linear model | Logistic regression |
|---|---|---|
| Outcome | None: all variables are treated alike | One yes/no outcome |
| What is modelled | The count in each cell of the table | The log-odds of the outcome |
| Answers | Which variables are associated, and whether an association holds within strata | How predictors change the odds of the outcome |
| Teaching table | Adding [TO] to [HT][HO]: G² falls by 0.05, p = 0.82 | Infection on hospital and technique: likelihood ratio test for technique 0.05, p = 0.82 |
| Link | A log-linear model that contains the [HT] term gives the same test as the logistic model | Preferred when one variable is clearly the outcome |
Decide
Which count model fits your data?
Answer the questions in order. Each answer links to its section.
What do your data look like?
Which count model: all possible answers
- Poisson regression: Report the incidence rate ratio with its 95% CI and the dispersion you checked.
- Negative binomial regression: The same incidence rate ratios, with standard errors that allow for extra variation between patients.
- Zero-inflated or hurdle model: Models the zeros and the counts separately. Needs a clinical reason for a separate group with no events.
- Log-linear model: Poisson regression on the cell counts. The interaction terms describe the associations.
- Modified Poisson regression: Poisson regression on the yes/no outcome with robust standard errors gives risk ratios.
The formula
Worked example: the seizure trial
Made-up teaching data: the trial at the top of this chapter. 60 patients per group, followed for 3 to 6 months. Fitted in Python with statsmodels, with ln(months of follow-up) as the offset.
| Standard treatment | Add-on drug | |
|---|---|---|
| Patients | 60 | 60 |
| Seizures | 456 | 370 |
| Patient-months of follow-up | 271 | 282 |
| Rate per patient-month | 1.68 | 1.31 |
| Mean and variance of the counts | 7.6 and 34.4 | 6.2 and 72.6 |
| Patients with 0 seizures | 6 | 3 |
- Crude rate ratio: (370 ÷ 282) ÷ (456 ÷ 271) = 1.312 ÷ 1.683 = 0.78.
- Poisson regression: B = −0.2488, SE 0.070. IRR = e−0.2488 = 0.78, 95% CI e−0.2488 ± 1.96 × 0.070 = 0.68 to 0.89, p < 0.001.
- Check dispersion: Pearson χ² 813.07 on 118 df, ratio 6.89. The counts vary about seven times more than a Poisson distribution allows.
- Negative binomial regression: B = −0.2422, SE 0.165, α = 0.67. IRR = 0.78, 95% CI 0.57 to 1.09, p = 0.14.
- Compare the models: likelihood ratio test of α = 0, χ² = 332.4, p < 0.001. AIC 1041.3 (Poisson) against 710.9 (negative binomial).
- Other corrections: quasi-Poisson 95% CI 0.54 to 1.12 (p = 0.18). Poisson with robust standard errors 0.53 to 1.15 (p = 0.21).
- Zeros: 9 observed, 0.4 expected under Poisson, 10.0 under the negative binomial model. No zero-inflated model is needed.
- Absolute difference: 1.683 − 1.312 = 0.37 fewer seizures per patient-month, 37.1 per 100 patient-months.
Conclusion: the point estimate is the same, a 22% lower seizure rate, but once the variation between patients is allowed for, the data are compatible with anything from a 43% reduction to a 9% increase.
In a real paper
Count models in two published cohort studies
van Hasselt TJ, Dorner RA, Katheria A, Battersby C, Gale C, Lo DKH, et al. Neonatal morbidities and hospitalization in the first 2 years of life among infants born very preterm. JAMA Netw Open. 2025;8(9):e2530123.
doi:10.1001/jamanetworkopen.2025.30123 · PMID 40900591 · Free full text (PMC12409584)
The study: A national retrospective cohort of 39 413 children born at 22 to 31 weeks' gestation in England and Wales (2013 to 2018) and discharged home from neonatal care. The outcome was the total number of calendar days in hospital between neonatal discharge and age 2 years: a count that was 0 for about a third of children and very long for a few.
“Negative binomial regression was used to calculate the adjusted incidence rate ratio (AIRR) for total calendar days hospitalized, adjusting for gestational age, sex, small for gestational age, and season of neonatal discharge.”
The outcome is a count of days, not a yes/no event, so a count model was used. Negative binomial regression was chosen instead of Poisson regression because days in hospital vary far more between children than a Poisson distribution allows. The adjusted incidence rate ratio compares the expected number of days in hospital between groups of children with the same gestational age, sex, small-for-gestational-age status and season of discharge.
| Reported | Value | What it means |
|---|---|---|
| AIRR, bronchopulmonary dysplasia vs none | 1.80 (95% CI, 1.72-1.88) | Children with BPD were expected to spend 1.80 times as many days in hospital |
| AIRR, severe NEC vs none | 1.88 (95% CI, 1.65-2.15) | 88% more days in hospital |
| AIRR, neonatal brain injury vs none | 1.46 (95% CI, 1.36-1.57) | 46% more days in hospital |
| AIRR, <24 weeks vs 31 weeks (reference) | 2.03 (1.74-2.37) | A categorical predictor compared with its reference category |
| AIRR, male vs female (reference) | 0.86 (0.83-0.89) | Below 1: boys spent fewer days in hospital |
| Likelihood ratio test of α = 0 | P < .001 | Overdispersion present, so Poisson regression was not appropriate |
| Children at least once in hospital | 26 498 (67.2%) | About a third of children had a count of 0 |
- Is the reason for negative binomial rather than Poisson regression given? Here a likelihood ratio test of α = 0 is reported in the table footnote.
- Did every child have the same time at risk? Follow-up ran from neonatal discharge to age 2, and no offset is described.
- With about a third of children at 0 days, were the zeros checked against the zeros the model predicts?
- Are rates or expected days given as well as ratios? The authors give expected days for combinations, such as 40.6 days for a child born before 24 weeks with 3 morbidities.
- Is the reference category stated for each categorical predictor?
Buchardt AS, Nielsen JSA, Jensen A, Bohnstedt C, Munkholm A, Pedersen O, et al. Pediatric intensive care utilization and outcomes in Denmark. JAMA Netw Open. 2026;9(8):e2629876.
doi:10.1001/jamanetworkopen.2026.29876 · PMID 42616498 · Free full text (PMC13491108)
The study: A population-based retrospective cohort of children aged 0 to 17 years admitted to ICUs in 19 public Danish hospitals, 2019 to 2024: 7875 children and 9458 ICU admissions. The number of children at risk changed from year to year, so admission counts had to be turned into rates per person-year.
“To examine incidence over time, incidence rate ratios (IRRs) were modeled using Poisson regression with the logarithm of the number of person-years as offsets and comparing the IR in a given calendar year with the IR in the reference year (2020).”
Each calendar year contributes a count of admissions and a number of person-years. The logarithm of person-years enters as the offset, so the model compares admissions per person-year, not raw admission counts. Each year is a category compared with 2020, the reference year. The authors add that repeated contacts by the same child were allowed for with robust standard errors in the confidence intervals.
| Reported | Value | What it means |
|---|---|---|
| Person-time | 1 155 101 (2020) and 1 378 002 (2024) person-years | The denominator changed by 19%, so counts alone would mislead |
| ICU admission rate, 2020 | 1.35 (95% CI, 1.35-1.35) per 1000 person-years | Rate = admissions ÷ person-years |
| ICU admission rate, 2024 | 1.17 (95% CI, 1.17-1.17) per 1000 person-years | Rate × person-years: about 1,600 admissions in that year |
| IRR, 2024 vs 2020 | 0.86 (95% CI, 0.86-0.86) | A 14% lower ICU admission rate in 2024 |
- Are the confidence intervals plausible for the number of events? With about 1,600 ICU admissions a year, a Poisson approximation from the reported rates and person-years (our calculation) gives roughly 1.11 to 1.23 for the 2024 rate and 0.81 to 0.93 for the IRR, not intervals identical to the estimates.
- Was overdispersion or clustering addressed? Here repeated contacts by the same child were allowed for with robust standard errors.
- Is the offset the logarithm of the right denominator (person-years of children at risk)?
- Is the reference year stated, and was a sensitivity analysis done with another reference year? The authors repeated the analysis with 2022.
How to run it
Running Poisson, negative binomial and log-linear models in SPSS, R and jamovi
Menu paths are from the IBM SPSS Statistics 27 manuals. Functions and arguments are from the CRAN reference manuals and the R documentation.
SPSS
- Create the offset: Transform > Compute Variable, with ln_months = LN(months). The offset must be the logarithm of the time at risk.
- Analyze > Generalized Linear Models > Generalized Linear Models. On the Type of Model tab, under Counts, choose Poisson loglinear.
- On the Response tab choose the count. On the Predictors tab add factors and covariates and put ln_months in Offset. Add the effects on the Model tab.
- The goodness-of-fit statistics include the deviance and Pearson chi-square. Divide Pearson chi-square by the residual degrees of freedom to check dispersion. The IRR is eB.
- For negative binomial regression, the Negative binomial with log link option fixes the ancillary parameter at 1. To estimate it, choose Custom, distribution Negative binomial, link Log, and Estimate value for the parameter.
- Log-linear models: Analyze > Loglinear > Model Selection fits hierarchical log-linear models with backward elimination. Analyze > Loglinear > General fits a specified model.
R
fit_p <- glm(seizures ~ drug + offset(log(months)), family = poisson, data = d) exp(cbind(IRR = coef(fit_p), confint.default(fit_p))) sum(residuals(fit_p, type = "pearson")^2) / df.residual(fit_p) # dispersion ratio performance::check_overdispersion(fit_p) fit_nb <- MASS::glm.nb(seizures ~ drug + offset(log(months)), data = d) # estimates theta = 1/alpha exp(cbind(IRR = coef(fit_nb), confint.default(fit_nb))) fit_q <- glm(seizures ~ drug + offset(log(months)), family = quasipoisson, data = d) lmtest::coeftest(fit_p, vcov. = sandwich::vcovHC(fit_p, type = "HC0")) # robust standard errors pscl::zeroinfl(cigs ~ age | age, dist = "negbin", data = z) # count part | zero part performance::check_zeroinflation(fit_nb) m1 <- glm(n ~ H*T + H*O, family = poisson, data = cells) # log-linear: [HT][HO] m2 <- update(m1, . ~ . + T:O) anova(m1, m2, test = "Chisq")
jamovi
- Log-linear models: Analyses → Frequencies → Log-Linear Regression, with the categorical variables as factors and the cell counts as the counts variable.
- Poisson and negative binomial regression need the GAMLj module, installed from the jamovi library. It adds a Linear Models menu containing Generalized Linear Models, with Poisson, Poisson (overdispersion) and Negative binomial model types.
- GAMLj's Offset variable enters the model with its coefficient fixed at 1, so supply ln(time at risk), not the time itself.
How to report it
What to write in the thesis and the paper
Give the counts, the time at risk and the rates, say how you checked dispersion, then give the rate ratio with its confidence interval.
Methods
- The count outcome and how time at risk was measured (person-years, catheter-days, months of follow-up), and that its logarithm was the offset.
- The model and why: Poisson, negative binomial, quasi-Poisson or robust standard errors, and how overdispersion and excess zeros were assessed (STROBE item 12a: describe all statistical methods).
- Predictors adjusted for and why (STROBE item 16a), reference categories, software and version.
Results
- Events, time at risk and rate in each group, then unadjusted and adjusted IRRs with 95% CIs.
- The dispersion statistic or test result, and absolute rate differences where they help (STROBE item 16c).
A worked sentence using this chapter's teaching numbers
Over 553 patient-months of follow-up there were 456 seizures with standard treatment (1.68 per patient-month) and 370 with the add-on drug (1.31 per patient-month). Seizure counts were overdispersed (Pearson χ² ÷ df 6.89; likelihood ratio test of α = 0, p < 0.001), so negative binomial regression with ln(months of follow-up) as the offset was used. The add-on drug was associated with a 22% lower seizure rate (incidence rate ratio 0.78, 95% CI 0.57 to 1.09, p = 0.14), or 0.37 fewer seizures per patient-month.
By specialty
Count model problems by specialty
An add-on antiepileptic trial counts seizures from diaries, with follow-up of 3 to 6 months per patient.
Use ln(months of follow-up) as an offset, and expect overdispersion: a few patients have many more seizures than the rest.
A region of interest records 10,000 counts in a gamma camera image.
Counts from radioactive decay follow a Poisson distribution, so the SD is √10,000 = 100, a relative uncertainty of 1%. With 100 counts it is 10%.
New tuberculosis cases by district, where districts have very different populations.
Model the counts with ln(population × years) as an offset and report incidence per 100,000 person-years with rate ratios.
Central line-associated bloodstream infections before and after a care bundle, in ICUs with different numbers of catheter-days.
Compare infections per 1,000 catheter-days. More infections can still be a lower rate.
Total days in hospital in the first two years after neonatal discharge. Many children have 0 days and a few have months.
Days in hospital are a count with large overdispersion. Negative binomial regression gives incidence rate ratios for the expected number of days.
Moderate and severe COPD exacerbations per patient over one year of follow-up, with some patients withdrawing early.
Use negative binomial regression with ln(years observed) as an offset, so that patients who withdrew early still contribute their time.
Number of self-harm episodes in a year after discharge. Most patients have none.
Check whether a negative binomial model predicts the zeros before choosing a zero-inflated model. A zero-inflated model needs a clinical reason for a group that cannot have the event.
A three-way table of surgical site infection by operative technique and hospital.
A log-linear model shows whether technique and infection are associated within each hospital, not only in the pooled table.
Common myths
Common mistaken beliefs
Myth: More events in one group means a higher rate.
Only if time at risk is the same. ICU A had twice ICU B's infections and a lower rate: 5.0 against 7.5 per 1,000 catheter-days.
Myth: A very small p-value from Poisson regression settles the question.
Check dispersion first. In the teaching trial Poisson regression gave p < 0.001 and negative binomial regression p = 0.14 for the same rate ratio of 0.78.
Myth: Many zeros always need a zero-inflated model.
A negative binomial model often predicts them. In the seizure trial it expected 10.0 zeros against 9 observed.
Myth: The offset is one more predictor to adjust for.
Its coefficient is fixed at 1, and it must be the logarithm of the time at risk.
Myth: An incidence rate ratio is the same as a risk ratio.
The IRR compares events per unit of person-time and counts every event. The risk ratio compares the proportion of people with at least one event.
Myth: Counts can be analysed with a t-test on the mean count.
A t-test ignores unequal follow-up and the link between the mean and the variance, and gives no rate ratio.
Why this matters to you
Five consequences of getting count models wrong
Protocol sent back
A plan that compares "number of infections" between wards without catheter-days or patient-days as the denominator.
A wrong conclusion in the thesis
Poisson regression on overdispersed seizure counts gives a p-value that is far too small, and a drug is declared effective on weak evidence.
Questions you cannot answer at the viva
"How did you allow for different follow-up?" and "Did you check whether the variance was larger than the mean?" need the offset and a dispersion statistic.
Misreading papers
Accepting a rate ratio with no statement of the time at risk, or confidence intervals that are narrower than the number of events allows.
Harm to patients
An infection-control unit that treats more catheter-days as "more infections" may change a practice that was working.
History
History of count models
- 1837
Siméon-Denis Poisson
Published a monograph on probabilities in which he derived the distribution now named after him, as a limit of the negative binomial distribution.
- 1898
Ladislaus von Bortkiewicz
Published data on deaths from horse kicks in corps of the Prussian army, each observed over 20 years, in his "law of small numbers". Armitage later noted that the near-Poisson overall distribution could hide considerable variation between corps.
- 1920
Major Greenwood and G. Udny Yule
Published "An inquiry into the nature of frequency distributions representative of multiple happenings with particular reference to the occurrence of multiple attacks of disease or of repeated accidents".
- 1972
John Nelder and Robert Wedderburn
Published "Generalized linear models", which fitted normal, binomial, Poisson (contingency tables) and gamma models by one method.
- 1989
C. B. Dean and Jerald Lawless
Published "Tests for detecting overdispersion in Poisson regression models" in the Journal of the American Statistical Association.
- 1992
Diane Lambert
Described zero-inflated Poisson regression for count data with excess zeros, with an application to soldering defects on printed wiring boards.
- 2004
Guangyong Zou
Proposed modified Poisson regression, with robust standard errors, to estimate relative risks directly in prospective studies with binary data.
Guidelines
Count models in reporting guidelines
“Describe all statistical methods, including those used to control for confounding.”
“Give unadjusted estimates and, if applicable, confounder-adjusted estimates and their precision (e.g., 95% confidence intervals). Make clear which confounders were adjusted for and why they were included.”
“If relevant, consider translating estimates of relative risk into absolute risk for a meaningful time period.”
Reading a paper
Six checks on any count model
- Is the time at risk (person-years, catheter-days, follow-up) stated, and was its logarithm used as an offset when it differed between units?
- Are the event counts and rates given for each group, not only the rate ratio?
- Was overdispersion checked, and was negative binomial regression, quasi-Poisson or robust standard errors used when it was present?
- If there are many zeros, were they compared with the zeros the model predicts, and is there a clinical reason for any zero-inflated model?
- Are the confidence intervals plausible for the number of events?
- For a multi-way table, was the association checked within strata as well as in the pooled table?
Why is it called that?
Word surgery
“Rate”
A speed, a price, or a percentage, as in "success rate".
Events divided by the time at risk, such as 1.68 seizures per patient-month. A "success rate" that is a proportion is not a rate in this sense.
“Offset”
Something that balances something else, as in "offset the cost".
The logarithm of each unit's time at risk, added to a count model with its coefficient fixed at 1.
“Dispersion”
Scattering, as in the dispersal of a crowd.
The variance of a count relative to its mean. Overdispersion means the variance is larger than a Poisson distribution allows.
Counts need three questions: over how much time (offset), with how much variation (variance ÷ mean), and with how many zeros (observed against expected).
Poisson
named after Siméon-Denis Poisson, who described the distribution in 1837
The distribution of the number of events that occur independently at a constant rate, with variance equal to the mean.
Dispersion
Latin dispersio: "a scattering"
How widely counts are spread. Overdispersion: more spread than a Poisson distribution with the same mean.
Rate
Medieval Latin rata (pars): "fixed (amount)"
Events per unit of time at risk. The incidence rate ratio compares two rates.
Count
Latin computare: "to count, sum up, reckon together"
A number of events: 0, 1, 2 and so on, never negative.
Offset
"something set off against something else, a counterbalance", from 1769
The log of time at risk, which balances the count against how long each unit was observed.
Exam answers
Model answer outlines
Poisson distribution
MD Nuclear Medicine 2019, 2021, 2022, 2023 · MD Community Medicine 1992, 2016- Definition: a discrete probability distribution of the number of events in a fixed interval of time or space, when events occur independently at a constant average rate. Named after S.-D. Poisson (1837).
- Formula: P(X = k) = e−μ μk ÷ k!, for k = 0, 1, 2, …, where μ is the mean number of events in the interval.
- Conditions: many opportunities, each with a small probability; independent events; constant rate; two events cannot occur at exactly the same instant.
- Properties: one parameter, μ. Mean = variance = μ, SD = √μ. Skewed to the right when μ is small, close to normal when μ is large. The binomial distribution approaches it when n is large and p small, with μ = np. The sum of independent Poisson counts is also Poisson.
- Worked example: μ = 2 events a year. P(0) = e−2 = 0.135. P(5 or more) = 0.053.
- Nuclear medicine: radioactive decay counts follow a Poisson distribution. The SD of N counts is √N, so relative uncertainty is 1 ÷ √N: 10% for 100 counts, 1% for 10,000. Longer acquisition or higher counts give more precise images and measurements.
- Community medicine: rare events in large populations: cases of a disease per year in a district, deaths per 1,000 person-years, confidence limits for a small number of cases, and comparison of incidence rates.
- Checking the fit: compare variance with mean. Variance > mean (overdispersion) suggests clustering or differences between individuals, which a negative binomial distribution allows for. Observed and expected frequencies can be compared by a χ² goodness-of-fit test.
- Poisson regression: models counts and rates with predictors, using ln(person-time) as an offset. eb is the incidence rate ratio. Check for overdispersion and excess zeros.
- Limitations: real counts often vary more than the Poisson model allows. Events that cluster (outbreaks, repeated seizures in the same patient) break the independence assumption.
The one thing to remember
Before modelling a count, divide it by the time at risk, and check whether its variance is larger than its mean.
All worked examples use made-up numbers for teaching. Models were fitted in Python 3 with statsmodels 0.14.5 and SciPy 1.15.3.
Sources: van Hasselt TJ et al. JAMA Netw Open 2025;8(9):e2530123 (doi:10.1001/jamanetworkopen.2025.30123, PMID 40900591). Buchardt AS et al. JAMA Netw Open 2026;9(8):e2629876 (doi:10.1001/jamanetworkopen.2026.29876, PMID 42616498). Seneta E. Poisson, Siméon-Denis. Encyclopedia of Biostatistics. 2005 (doi:10.1002/0470011815.b2a17119). Orton C. Archaeology International 2006;10 (doi:10.5334/ai.1005). Griffith DA, Haining R. Geographical Analysis 2006;38(2):123–39 (doi:10.1111/j.0016-7363.2006.00679.x). Pandit JJ. Anaesthesia 71(1):7–11, published online 23 November 2015 (doi:10.1111/anae.13261, PMID 26597473). Armitage P. Bortkiewicz, Ladislaus von. Encyclopedia of Biostatistics. 2005 (doi:10.1002/0470011815.b2a17016). Greenwood M, Yule GU. J R Stat Soc 1920;83(2):255 (doi:10.2307/2341080). Nelder JA, Wedderburn RWM. J R Stat Soc Series A 1972;135(3):370 (doi:10.2307/2344614). Dean C, Lawless JF. J Am Stat Assoc 1989;84(406):467–72 (doi:10.1080/01621459.1989.10478792). Lambert D. Technometrics 1992;34(1):1 (doi:10.2307/1269547). Zou G. Am J Epidemiol 2004;159(7):702–6 (PMID 15033648). von Elm E et al. STROBE statement. PLoS Med 2007;4(10):e296 (PMID 17941714), and Vandenbroucke JP et al. STROBE explanation and elaboration. PLoS Med 2007;4(10):e297 (PMID 17941715). IBM SPSS Statistics 27 Advanced Statistics and Core System manuals. CRAN reference manuals: stats (R documentation), MASS, pscl, performance, sandwich, lmtest, jmv. GAMLj and jamovi documentation.
Past papers
TNMGRMU questions on poisson and log-linear models
Questions from MD, MS, DM, MCh and Ph.D. papers that this chapter helps you answer. Tap a sitting to open the university's own question paper.
- ×6Poisson distribution