GLM (Poisson Log-Linear Model)The underlying model family class (e.g. GLM, linear model, categorical matrix, log-linear).Parametric ReferenceStatistical methods that assume a specific probability distribution family (typically normal).12-stage workflow
Poisson Regression
The engine for Frequency Discovery. Poisson Regression audits the rate at which discrete events occur (e.g., counts per unit time/space) across a field of multivariable predictors.
Model familyGLM (Poisson Log-Linear Model)
Hypothesistwo-tailed
AliasesLog-Linear Count Model · Incidence Rate Regression · The Rare Event Engine
G1
Rate Isolation
Determine the incidence rate of events while accounting for varying exposure times.
G2
Frequency Mapping
Identify the predictors that multiply or divide the expected count of occurrences.
G3
Count Synergy Audit
Detect how multiple factors jointly influence the 'rare event' landscape.
1
What is it?
Poisson Regression models outcome variables that represent counts (positive integers: e.g. visits, counts, incidents) using an exponential log-link curve.
2
When to use it
Integer Counts: Outcome variable consists of zero or positive count integers.
Skewed Ratios: Variance grows proportionally with the mean magnitude.
3
Core Idea
It models log(expected count) as a linear function. The predicted outcome counts grow exponentially:
4
Poisson vs Negative Binomial
Poisson forces the assumption that Variance = Mean. In real data, count variance is usually higher. Negative Binomial adds an overdispersion parameter (dispersion coefficient alpha) where Variance = Mean + alpha * Mean^2.
5
Assumptions
🔢 Count Outcome: Strictly integer numbers >= 0.
📈 Log-Linearity: Predictor relations are linear on the logarithmic scale.
Interactive Sandbox
Poisson Count Live Laboratory
Change the growth slope and check how count dispersion shifts model residuals.
Presets
Growth Rate Slope (b1)0.40
Sample Size (N)25
Count Scatter plot (X: -2 to 2; Count Y axis)Blue line shows fitted exponential mean curve
Model Fit Output
Metric
Value
Fitted Model Deviance
37.277
df Residuals
23
Statistical Verdict
✅ Significant Relationship
The count variable trends upward with X. Deviance fit chi2 p-value = 0.0270.
Pragmatic null and alternative hypotheses defined in mathematical notation.
We ask not just 'is there a link?', but 'how much does Y change for every unit of X?'
Logic Core
Null · H₀
H₀: β₁ = 0 (predictor has no effect on log-count)
Alternative · Hₐ
Hₐ: β₁ ≠ 0 (predictor affects log-count)
Why it matters two-tailed
Coefficients are in log-count scale. Exponentiate for incident rate ratios (IRR).
02Model diagnostics
Assumptions
The core mathematical criteria needed to ensure that statistical testing remains unbiased and valid.
Linearity is a strong claim. Nature often curves; ensure your model does not force a straight line on a bent world.
Integrity Shield
7
Assumptions
0
Critical / High Severity
How to check
Verify outcome variable contains only non-negative integers. Check histogram of outcome. Ensure zeros are true zeros (absence of events), not missing data. Confirm counts are unbounded (no upper limit imposed by measurement).
If violated
If outcome has upper bound: use binomial or beta-binomial models. If outcome is continuous: use linear regression or other continuous models. If outcome is proportion: use logistic or beta regression. If outcome is rate per unit time/space: use Poisson with offset term.
How to check
Examine study design for clustering, repeated measures, or spatial/temporal dependence. Check for overdispersion (variance > mean), which can result from unmodeled dependence. Plot residuals for patterns suggesting dependence.
If violated
Use negative binomial regression if overdispersion present (common when independence violated). Apply mixed-effects Poisson models for clustered/hierarchical data. Use generalized estimating equations (GEE) for correlated data. Add random effects for repeated measures.
How to check
Calculate variance-to-mean ratio (dispersion parameter) for outcome. Ratio ≈ 1 indicates equidispersion, >1 indicates overdispersion, <1 underdispersion. Conduct formal tests: Pearson chi-square/df or deviance/df (values >> 1 suggest overdispersion). Use Cameron-Trivedi overdispersion test.
If violated
Overdispersion (most common): Use negative binomial regression, which adds dispersion parameter. Use quasi-Poisson regression for adjusted standard errors. Check for zero-inflation if many zeros present. Underdispersion (rare): May indicate model misspecification or data issues; investigate carefully.
How to check
Plot log-transformed outcome against predictors (though zeros problematic). Examine deviance residuals vs. predictors for non-linear patterns. Use component-residual plots. Test polynomial or spline terms for predictors.
If violated
Add polynomial terms (X²) if curvilinear relationship suspected. Use splines or generalized additive models (GAM) for complex non-linear relationships. Transform predictors (log, sqrt) if theoretically justified. Consider categorizing continuous predictors as last resort.
How to check
Quick
Calculate proportion of zeros in data. Compare observed zeros to expected zeros from fitted Poisson model: sum(dpois(0, fitted_values)). If observed zeros >> expected zeros (ratio > 1.3-1.5), suspect zero-inflation. Rule of thumb: if >30% zeros in low-count data (mean < 2), investigate zero-inflation.
Rigorous
Use rootogram to visualize observed vs. expected frequencies (hanging bars indicate poor fit). Conduct Vuong test comparing standard model (Poisson/NB) to zero-inflated version (ZIP/ZINB): significant z-statistic favors zero-inflated model. Fit both models and compare AIC/BIC: ΔAIC > 10 strongly favors model with lower AIC. Test zero-inflation component separately: does a theoretically distinct process generate excess zeros (e.g., never-users vs. occasional users)?
If violated
Excess zeros arise from two sources: (1) Structural zeros: Some observations can never experience the event (e.g., non-smokers can't have smoking-related events), (2) Sampling zeros: Random zeros from low event rates. Solutions: Use zero-inflated Poisson (ZIP) if equidispersed, or zero-inflated negative binomial (ZINB) if overdispersed. ZIP/ZINB models two processes: (a) logistic regression for probability of 'always-zero' group, (b) count model for non-zero group. Specify theoretically meaningful predictors for zero-inflation component (may differ from count component). Hurdle models are alternative: model zero vs. non-zero separately, then model counts among non-zeros (truncated Poisson/NB). Report AIC/BIC comparison and zero-inflation parameter estimates.
How to check
Quick
Ask: Do observations differ in opportunity for events? Examples: varying follow-up times (person-years), different region sizes (population at risk), unequal observation periods. If yes, offset is required. Check if counts scale proportionally with exposure: plot counts vs. exposure—should be roughly linear through origin if Poisson assumption holds.
Rigorous
Compare model with vs. without offset using likelihood ratio test or AIC/BIC. Model without offset when needed shows: (1) residual patterns correlating with exposure, (2) biased coefficient estimates (confounds count vs. rate), (3) poor predictions for observations with atypical exposure. Fit both: glm(count ~ predictors, family=poisson) vs. glm(count ~ predictors + offset(log(exposure)), family=poisson). If ΔAIC > 4, offset is necessary.
If violated
Omitting offset when needed leads to: (1) Coefficients estimate effects on total counts rather than rates, making comparisons invalid across observations with different exposures, (2) Confounding exposure with predictors if exposure correlates with X variables, (3) Biased predictions—model over-predicts for short exposures, under-predicts for long exposures. Correct specification: Include offset(log(exposure)) in model formula. This fixes the coefficient of log(exposure) at 1.0, ensuring model estimates rates: log(E[count]/exposure) = β₀ + β₁X₁ + .... Equivalent to: log(E[count]) = log(exposure) + β₀ + β₁X₁. Interpret coefficients as effects on rate per unit exposure. If exposure variable has zeros, add small constant (e.g., 0.5) before log transform, or use alternative parameterization.
How to check
Quick
Apply rule of thumb: Need at least 10-15 events per predictor variable (EPV). Calculate total events = sum(outcome_counts). Divide by number of predictors. EPV < 5 is problematic, EPV < 10 is concerning, EPV ≥ 15 is adequate. For overall model: N ≥ 100 + 20k where k = number of predictors. Check mean count: if mean < 1, need larger N for stable estimates.
Rigorous
Conduct simulation-based power analysis for count data using methods from Zuur et al. or Cameron & Trivedi. Account for: (1) expected mean count (lower mean = more power needed), (2) overdispersion if present (increases required N), (3) exposure variability (unequal exposure reduces effective N), (4) proportion of zeros (high zero proportion reduces effective N). Use R packages: simglm, fastPOCS, or custom simulation matching your data structure. Target: 80% power to detect minimum meaningful incidence rate ratio (e.g., IRR = 1.2-1.5 depending on context).
If violated
Small samples in Poisson regression cause: (1) Unstable coefficient estimates with wide confidence intervals, (2) Separation problems (perfect prediction) if categorical predictors have rare categories, (3) Inflated Type I error if event count too small, (4) Convergence failures in maximum likelihood estimation, (5) Biased estimates (small-sample bias in GLM). Solutions: (1) Combine rare categories of categorical predictors if theoretically defensible, (2) Use penalized likelihood methods (Firth's bias reduction) for small samples, (3) Apply exact Poisson tests for very small counts rather than asymptotic MLE, (4) Bootstrap confidence intervals (but still unreliable if events << 50), (5) Report exact p-values and wide confidence intervals, acknowledging uncertainty, (6) Consider Bayesian Poisson regression with informative priors if prior knowledge available, (7) Do not over-interpret null findings—may lack power rather than indicating no effect.
03Residual Forensics
Diagnostics
Checking residual plots and indices to examine model deviations and ensure standard error integrity.
Trust, but verify. The outliers often hold more truth than the averages.
Variance-to-mean ratio: Calculate var(Y)/mean(Y) for raw outcome (≈1 if Poisson appropriate, >1.5 suggests overdispersion)
Residual plots: Deviance residuals vs. fitted values (check for patterns suggesting model misspecification)
Zero-inflation check: Compare observed zeros to expected zeros from model (ratio > 1.3 problematic)
Model comparison: AIC/BIC for Poisson vs. Negative Binomial (ΔAIC > 2 favors model with lower AIC)
Recommended checks
Cameron-Trivedi overdispersion test (formal test: H₀ = equidispersion; p < .05 indicates significant overdispersion)
Rootogram: Visualize observed vs. expected frequencies across count values (hanging bars show poor fit)
Influential observations: Cook's distance for count data (> 4/n problematic); DFBETAS for coefficient influence
Quantile residual plots: Better than deviance residuals for detecting violations; should be uniform(0,1) if model correct
Mean-variance relationship plot: Bin observations by fitted values; plot bin means vs. bin variances (should follow Var=Mean line)
Vuong test: Compare non-nested models (Poisson vs. ZIP, NB vs. ZINB); |z| > 1.96 favors one model
Link function check: Plot log(Y+0.5) vs. linear predictor; should be linear if log-link appropriate
Simulated envelope plots: Generate simulated residuals from fitted model; observed residuals should fall within envelope
Partial residual plots: Check linearity of log-linear relationship for each continuous predictor
04Live Instances
Applied Minds
Review concrete study examples, data layout guidelines, and copy executable syntax scripts.
Theory is the map. Practice is the terrain. Simulation bridges the gap.
Applied Wisdom
Example 01
Number of Doctor Visits Predicted by Health Status
Research question: How do age, chronic conditions, and insurance status predict the number of doctor visits in a year? Count outcome with potential overdispersion.
05Tactical Pivots
Alternatives
Structured fallback pathways for choosing alternative tests when normality or slopes requirements fail.
When the path is blocked, pivot. Rigor is not rigidity; it is the intelligent adaptation to reality.
Significance is noise. Magnitude is the signal. Measure the impact, not just the probability.
Impact Magnitude
Incidence Rate Ratio = exp(β) represents multiplicative effect on expected count. IRR = 1.00 (no effect; count unchanged), IRR > 1 (increases count; e.g., IRR = 1.50 = 50% increase in count per unit increase in X), IRR < 1 (decreases count; e.g., IRR = 0.75 = 25% decrease in count per unit increase in X). Always report with 95% CI: IRR = 1.42, 95% CI [1.28, 1.57]. CI excluding 1.0 indicates significant effect at α=.05. For categorical predictors: IRR compares count in category vs. reference category. For continuous predictors: IRR represents effect of 1-unit increase. Practical interpretation: 'Each additional chronic condition multiplies doctor visits by 1.42, a 42% increase.' Note: IRR is ratio scale, so IRR=2.0 (doubling) is not twice as large as IRR=1.5; use log(IRR) for additive comparisons.
Pseudo-R² measures model fit for count models but cannot be interpreted as 'variance explained' like OLS R². Multiple versions exist: (1) McFadden's R² = 1 - (LL_model / LL_null): values 0.20-0.40 considered excellent, 0.10-0.20 good, <0.10 weak; (2) Cox-Snell R² = 1 - (L_null/L_model)^(2/n): bounded by <1, harder to achieve high values; (3) Nagelkerke R² = Cox-Snell R² / max possible Cox-Snell: normalized to [0,1] range, easier to interpret. Report multiple pseudo-R² measures for comprehensive fit assessment. Cannot compare pseudo-R² across different model families (Poisson vs. NB)—use for comparing nested models only.
Proportion of null deviance explained: (Deviance_null - Deviance_model) / Deviance_null. Analogous to R² but based on deviance reduction rather than variance. Interpretation: proportion of model lack-of-fit (relative to null model) resolved by adding predictors. Values: 0 = model no better than null, 1 = perfect fit (impossible with real data). Typical range: 0.10-0.50 for count models. Compare deviance explained across nested models to assess contribution of predictor blocks.
For continuous predictors, report effect of 1 SD change rather than 1-unit change to facilitate comparison across predictors with different scales. Standardized IRR = exp(β × SD_X). Example: If β = 0.35 and SD_X = 2.5, standardized IRR = exp(0.35 × 2.5) = exp(0.875) = 2.40. Interpretation: '1 SD increase in X multiplies count by 2.40 (140% increase).' More interpretable than raw IRR when unit change is arbitrary. Compare standardized IRRs to identify strongest predictors.
Practical effect size: Calculate predicted counts at meaningful predictor values and report difference. Example: 'Patients with insurance averaged 8.2 doctor visits vs. 5.5 for uninsured (difference = 2.7 visits, 49% increase).' Use model to predict counts at X̄ ± 1SD or clinically meaningful thresholds. Report absolute difference (counts) and percentage difference for concrete interpretation. Include 95% CIs for predictions using delta method or bootstrapping.
Recommended Metric: Report IRR with 95% CI for each predictor; report pseudo-R² for overall model fit; calculate predicted count differences for key comparisons to communicate practical significance
Small 0.2
Medium 0.5
Large 0.8
0.50
Report IRR with 95% CI for each predictor; report pseudo-R² for overall model fit; calculate predicted count differences for key comparisons to communicate practical significance
Recommended Measure
5
Available Metrics
ReportUse Report IRR with 95% CI for each predictor; report pseudo-R² for overall model fit; calculate predicted count differences for key comparisons to communicate practical significance to represent clinical impact magnitude.
08Statistical Power
Sample Size
Guidelines for minimum sample requirements and power analysis parameters.
An underpowered study is an ethical failure. Respect the data by collecting enough of it.
Power Protocol
Floor Requirements
The 'Rate Stability Buffer': A minimum of 50-100 total counts (summed across the sample) is required to ensure the rate estimation reaches statistical authority.
Effect Size
Parameters
Required n
Small Effect
Exp(B) = 1.2 (Small)
n ≈ 450
Medium Effect
Exp(B) = 1.5 (Medium)
n ≈ 90
Large Effect
Exp(B) = 2.0 (Large)
n ≈ 40
Key considerations
Overdispersion is the 'Significance Hijacker'. If your variance exceeds your mean, Poisson p-values will be artificially 'Inflated', claiming discovery where only noise exists. Audit dispersion before trusting the N.
G*Power StrategyBenchmark: Z-tests → Poisson Regression. Parameters: Base Rate = 1.0, Mean Exposure = 1.0, α = .05, Power = .80. Note: In count models, power is a function of the 'Mean Rate'—higher rates allow for smaller samples.
09APA narrative blueprint
Reporting
How to compile statistical results into publication prose matching APA and journal style guides.
The Beta coefficient is the currency of change. Interpret it in real-world units, not just standardized abstractions.
Narrative Arc
10Exhibit Builder
Manuscript Lab
Copy standard summary tables and forensic reporting grids to outline analysis details.
Note. Outcome: Number of adverse events over 12 months. N = 250. Dispersion Parameter = 1.02 (within normal limits).
Treatment IRR = 0.56High Clinical Significance. The intervention effectively halved the event rate after adjusting for baseline risk and age.
Dispersion (1.02)Confirms model integrity. The data follows the Poisson distribution perfectly, suggesting no unobserved clustering.
Header glossary
The Rate Multiplier. IRR = 0.56 means the treatment group had 44% fewer events than the control group.
The Variance Audit. In Poisson, mean must equal variance. If variance is higher, the model is 'overdispersed' and invalid.
The Coefficient Strength. The number of standard errors the estimate is away from zero.
11Algorithmic Logic
Command Center
Syntax libraries and function parameters for executing calculations in stats packages.
Code your model to handle residuals. The errors tell you what your model missed.
Execution Engine
# 1. Fit Poisson Model
model <- glm(events ~ treatment + age, data = df, family = 'poisson')
summary(model)
# 2. Extract IRR with Robust SEsexp(coef(model))
lmtest::coeftest(model, vcov = sandwich::vcovHC)
Library stack
R
statssandwichlmtest
Python
statsmodels
Elite Forensic Strike
The 'Overdispersion Trap' is the most common failure in Poisson models. Always check if variance exceeds the mean.
# Automated Dispersion Audit
performance::check_overdispersion(model)
# If significant (p < .05), pivot to Negative Binomial Regression.
12The Over-adjustment Trap
Common Mistakes
Analytical caveats and corrections to maintain modeling integrity.
Wisdom is learning from the failures of others. Anticipate the error before it occurs.
Defensive Logic
Why it's wrong
When variance exceeds mean (overdispersion), Poisson standard errors are underestimated, leading to inflated Type I error rates (false positives). P-values and confidence intervals are incorrect. This is the most common and serious mistake in count modeling.
The correction
Always check for overdispersion using deviance/df or Pearson χ²/df (values >1.5 suggest overdispersion). Conduct formal tests (Cameron-Trivedi). If overdispersed, use negative binomial regression or quasi-Poisson. Compare AIC/BIC to select best model. Report dispersion diagnostics.
Why it's wrong
Raw Poisson coefficients (β) are on the log scale and difficult to interpret meaningfully. A coefficient of 0.35 doesn't mean '0.35 increase in count'—it means log(count) increases by 0.35, which corresponds to a multiplicative effect on the count itself.
The correction
Always exponentiate coefficients to obtain Incidence Rate Ratios: IRR = exp(β). Report IRRs with interpretation: 'IRR = 1.42 means a 42% increase in count per unit increase in predictor.' Exponentiate confidence intervals too. Include both β and IRR in technical reports.
Why it's wrong
Poisson requires non-negative integer counts that are theoretically unbounded. Using it for continuous data (e.g., 3.5), outcomes with upper bounds (e.g., test scores 0-100), or proportions violates fundamental distributional assumptions.
The correction
For continuous outcomes: use linear or other continuous regression. For bounded counts: use binomial or beta-binomial models. For proportions: use beta regression or logistic regression. For rates (count per unit time/area): use Poisson with offset term for exposure.
Why it's wrong
Standard Poisson and negative binomial assume zeros occur at rates predicted by the model. Excess zeros (more than model predicts) indicate a separate process generating zeros, violating model assumptions and producing poor fit.
The correction
Examine frequency of zeros in data vs. model predictions (use rootogram). If excess zeros present, consider zero-inflated Poisson (ZIP) or zero-inflated negative binomial (ZINB) models. Test ZIP vs. Poisson with Vuong test. Report proportion of zeros and model comparison results.
Why it's wrong
Poisson assumes predictors have linear relationships with log(count). Non-linear relationships on the log scale lead to biased estimates and poor predictions. Simply checking scatterplots of raw variables is insufficient.
The correction
Plot deviance residuals vs. each predictor to check linearity on log scale. Test polynomial terms (predictor²) if curvature suspected. Use splines or generalized additive models (GAM) for complex non-linearity. Transform predictors if theoretically justified (e.g., log-transform income).
Why it's wrong
When observations have different exposure periods (e.g., monitoring lengths vary) or areas (e.g., different region sizes), raw counts aren't comparable. Poisson without offset estimates total counts, not rates, producing misleading comparisons.
The correction
Include offset term for exposure: glm(count ~ x1 + x2 + offset(log(exposure))). This models rates (count per unit exposure) rather than raw counts. IRRs then represent rate ratios controlling for exposure differences. Always use offset when exposure varies.
Why it's wrong
Poisson assumes independence. Clustered data (multiple observations per unit) or repeated measures violate this assumption, leading to underestimated standard errors and inflated Type I error rates. Overdispersion often signals unmodeled dependence.
The correction
For clustered data: use mixed-effects Poisson models (random intercepts/slopes). For repeated measures: use generalized estimating equations (GEE) or mixed models. For spatial data: include spatial random effects. Test for within-cluster correlation. Adjust inferences for clustering.
13Academic Lineage
References
Scholarly lineage and citation keys grounding the statistical framework.
We stand on the shoulders of giants. Honor the source of the method.
Academic Lineage
[1]
Cameron, A. C., & Trivedi, P. K. (2013). Regression analysis of count data (2nd ed.). Cambridge University Press.
Comprehensive reference on count data models including Poisson, negative binomial, and zero-inflated models.
doi: 10.1017/CBO9781139013567
[2]
Hilbe, J. M. (2014). Modeling count data. Cambridge University Press.
Practical guide to count regression models with extensive examples and diagnostics.
doi: 10.1017/CBO9781139236065
[3]
Ver Hoef, J. M., & Boveng, P. L. (2007). Quasi-Poisson vs. negative binomial regression: How should we model overdispersed count data? Ecology, 88(11), 2766-2772.
Compares approaches to handling overdispersion in count data with practical recommendations.
doi: 10.1890/07-0043.1
[4]
Gardner, W., Mulvey, E. P., & Shaw, E. C. (1995). Regression analyses of counts and rates: Poisson, overdispersed Poisson, and negative binomial models. Psychological Bulletin, 118(3), 392-404.
Accessible introduction to Poisson regression for behavioral scientists with common applications.
doi: 10.1037/0033-2909.118.3.392
[5]
Coxe, S., West, S. G., & Aiken, L. S. (2009). The analysis of count data: A gentle introduction to Poisson regression and its alternatives. Journal of Personality Assessment, 91(2), 121-136.
Tutorial on Poisson regression with clear explanations of assumptions and alternatives.
doi: 10.1080/00223890802634175
14Model Ecosystem
Related Tests
Bridges to simpler, more complex, non-parametric, or alternative versions.
No model exists in isolation. Understanding the family tree reveals the true nature of the test.
Model Ecosystem
simpler
ols regression
more complex
negative binomial regressionzero inflated poisson
nonparametric equivalent
quantile regression
robust version
negative binomial regression
with covariates
negative binomial regression
In the world of counts, the mean and variance are siblings. If they drift too far apart, your model is telling a lie. Audit the dispersion before you trust the rate.