Poisson and Negative Binomial Regression Calculator: Rate Ratios and Overdispersion
Paste your data with a count outcome (insects per plant, colonies per plate, cases per district) and the predictors. The calculator fits Poisson, quasi-Poisson and negative binomial regression, reports incidence rate ratios (IRR) with 95% confidence intervals, likelihood-ratio tests for each predictor, an offset for unequal exposure (time, area, population), and tests for overdispersion so you know which model to trust.
Predictors
Tick the predictors to include. Text columns are categorical; switch numeric codes to Categorical when the numbers are labels. Each category is compared with its reference level.
- PriceFree, no login or sign-up needed
- Your dataProcessed in your browser, never uploaded
- Works onPhone, tablet or computer, any modern browser
- Made byDr. Muhammad Aammar Tufail, Codanics
- Published17 November 2026
- Last updated16 November 2026
📚 How to cite this tool
This tool is free. If it helped your thesis, paper, report or assignment, please cite it. It keeps the tools free and helps other students find them.
Tufail, M. A. (2026). Poisson and negative binomial regression calculator [Online tool]. Codanics. Retrieved 16 November 2026, from https://codanics.com/tools/poisson-regression-calculator/
In-text citation: (Tufail, 2026) · Narrative: Tufail (2026)
The access date is today’s date, filled in automatically. Author: Muhammad Aammar Tufail. Published 17 November 2026.
How to use the Poisson Regression Calculator
- Paste your dataset, use Paste from Excel or Upload CSV / Excel: one row per observation with a count outcome. R’s InsectSprays data (insects counted on 72 plots treated with six sprays) are loaded as an example.
- Choose the count outcome. If the observations had different exposure (observation time, plot area, population size), choose that column as the exposure; its logarithm becomes the offset.
- Tick the predictors, switch numeric codes to Categorical where needed and pick the reference levels.
- Click Run count regression. Leave the model on Automatic to switch to negative binomial when the counts are overdispersed, or choose a model yourself.
- Read the rate ratios and their CIs, the tests for each predictor and the overdispersion checks. Copy the APA table into Word or download the .docx, and predict the expected count for new values.
When to use Poisson regression
Use Poisson regression when the outcome is a count: insects per plant, lesions per leaf, bacterial colonies per plate, hospital admissions per day, publications per researcher. Counts are whole numbers, cannot be negative and usually have a variance that grows with the mean, so ordinary linear regression is a poor fit. Poisson regression models the logarithm of the expected count: log(μ) = b₀ + b₁X₁ + …, so exponentiated coefficients are rate ratios.
Interpreting the incidence rate ratio (IRR)
- IRR = 1.25: the expected count is 25% higher for each one-unit increase (or in that category compared with the reference).
- IRR = 0.21: the expected count is 79% lower. In the example, spray C reduced insect counts to 0.14 times those of spray A.
- If observations differ in exposure (counting time, area, population), add an offset: the model then compares rates (counts per unit of exposure).
Overdispersion: Poisson, quasi-Poisson or negative binomial?
The Poisson model assumes the variance equals the mean. Biological and clinical counts nearly always vary more (overdispersion), because individuals or plots differ in ways the predictors do not capture. Ignoring it gives standard errors that are too small and false “significant” results.
| Model | Variance | When to use |
|---|---|---|
| Poisson | μ | Dispersion close to 1, no significant overdispersion test |
| Quasi-Poisson | φ·μ | Overdispersion; same coefficients as Poisson, SEs × √φ; no AIC |
| Negative binomial | μ + μ²/θ | Overdispersion, especially when variance grows faster than the mean; has a likelihood and AIC |
With Automatic, the tool fits both models and uses the negative binomial when the likelihood-ratio test of Poisson vs negative binomial is significant. Too many zeros, which neither model explains, point to a zero-inflated model.
Formulas
The Poisson and quasi-Poisson results match glm(..., family = poisson / quasipoisson), the negative binomial results (coefficients, SEs, θ and its SE, AIC) match MASS::glm.nb(), the predictor tests match drop1() and anova(), and the Cameron–Trivedi test matches AER::dispersiontest(). Profile-likelihood CIs agree with confint() to about four to five significant digits.
How to report it
Frequently asked questions
What is the difference between Poisson and negative binomial regression?
Both model counts with a log link and give rate ratios. Poisson assumes the variance equals the mean; negative binomial adds a parameter θ so the variance can be larger (μ + μ²/θ). When the data are overdispersed, the negative binomial gives honest standard errors and p-values.
How do I know if my data are overdispersed?
Look at the Pearson dispersion (χ²/df): values well above 1 (say above 1.5) indicate overdispersion. The Cameron–Trivedi test and the likelihood-ratio test of Poisson vs negative binomial give formal p-values. The tool shows all three.
What is an offset and when do I need one?
An offset adjusts for unequal exposure. If you counted insects on plots of different sizes or for different times, or cases in populations of different sizes, choose that column as the exposure. The tool uses its logarithm as an offset, so the coefficients describe rates per unit of exposure.
How do I interpret an IRR?
An IRR is the multiplicative change in the expected count. IRR = 2 means twice as many events; IRR = 0.5 means half as many. (IRR − 1) × 100 gives the percentage change. For a categorical predictor, the IRR compares that level with the reference level.
Why is there no AIC for quasi-Poisson?
Quasi-Poisson is not a full likelihood model; it only rescales the Poisson standard errors. Without a likelihood there is no AIC. Use the negative binomial model if you want to compare models by AIC.
What if my data have a lot of zeros?
The tool compares the observed number of zeros with the number expected under the Poisson and negative binomial models. If there are many more zeros than expected, consider a zero-inflated or hurdle model (R package pscl).
Does it match R, Stata or SPSS?
Yes. Coefficients and SEs match R’s glm() and MASS::glm.nb(), Stata’s poisson and nbreg, and SPSS’s Generalized Linear Models with a log link. Note that SPSS’s default negative binomial fixes θ = 1 unless you ask it to estimate it; this tool always estimates θ by maximum likelihood.
Do I need to log in or create an account to use the Poisson Regression Calculator?
No. There is no login, no sign-up and no email required. Open the page and start using it straight away, for free, on any device.
How do I cite this tool in my thesis or paper?
Use the citation box on this page. In APA 7th edition: Tufail, M. A. (2026). Poisson and negative binomial regression calculator [Online tool]. Codanics. Retrieved [date you used it], from https://codanics.com/tools/poisson-regression-calculator/. BibTeX, RIS (EndNote, Mendeley, Zotero), MLA, Harvard, Chicago and Vancouver formats are also available.
Free guides and courses from Codanics
More free tools
See all free Codanics tools → · Codanics on YouTube · WhatsApp channel