Understand the idea
Poisson regression, the standard tool for modeling counts (visits per year, defects per batch), makes one very specific and often unrealistic assumption: that the spread of the counts exactly equals their average. Real count data almost always violate this: the actual spread is usually WIDER than Poisson expects, a phenomenon called overdispersion, usually because of some unmeasured source of variation between rows that Poisson has no way to account for.
Negative binomial regression keeps the same basic idea as Poisson (predicting an expected count that changes with your predictors) but adds one extra dial (a dispersion parameter) that lets the model admit the real spread is wider than a plain Poisson would allow. The predicted EFFECTS (how much each predictor changes the expected count) usually come out nearly identical to what Poisson would have said. What changes, and matters a great deal, is that the STANDARD ERRORS get appropriately wider, because negative binomial stops pretending the data are less variable than they actually are.
There's a clean, built-in way to check whether you even needed to switch from Poisson: because Poisson is exactly what negative binomial becomes when its dispersion parameter is set to zero, you can directly test whether the extra dispersion parameter is really needed. A small p-value on that test says 'yes, keep negative binomial'; a large one (with the dispersion estimate near zero) says Poisson was already adequate.
Negative binomial regression is a count regression for counts that vary more than a Poisson model allows. Negative binomial coefficients raised as powers of e are incidence rate ratios: a value of 1.2 means the expected count is 20% higher per unit of the predictor. NB2 is the standard form, in which the variance grows with the square of the mean.
Practitioner explanation
KernelStats fits the NB2 parameterization (the same one R's MASS::glm.nb and Stata's nbreg use): log(mu_i) = beta_0 + beta_1*X_1 + ..., with Var(Y|X) = mu + alpha*mu^2, a Gamma-Poisson mixture where each row's rate is Poisson but the rates themselves vary across rows according to a Gamma distribution, and alpha captures exactly that extra variability. Incidence-rate ratios (IRR_j = exp(beta_j)) are reported with the same interpretation as Poisson's IRR, and the product states directly that IRR point estimates are USUALLY CLOSE to what Poisson would give; the real difference is in the width of the standard errors and confidence intervals.
The overdispersion test is a BOUNDARY-CORRECTED likelihood-ratio test, computed correctly rather than naively: because alpha=0 sits on the edge of the parameter space (alpha cannot go negative), the ordinary chi-square-with-1-df reference distribution is technically wrong, and the correct null distribution is a 50:50 mixture of a point mass at 0 and chi-square-1: in practice this means HALVING the naive p-value (p = 0.5 * P(chi2_1 > LR)). KernelStats reports this boundary-corrected p-value as its headline overdispersion test rather than the naive, technically incorrect version many implementations report.
The product explicitly distinguishes three related models by how they widen standard errors, not by their point estimates (which are the same): Poisson (variance = mu, wrong SEs when overdispersed), quasi-Poisson (variance = phi*mu, a constant inflation factor, no proper likelihood so no AIC), and NB2 (variance = mu + alpha*mu^2, extra spread growing quadratically with the mean, a full likelihood enabling AIC/BIC and LR tests); NB2 is recommended specifically when excess variance grows WITH the mean (the common case), with quasi-Poisson offered as a lighter-weight alternative when the variance appears roughly proportional to the mean instead. Structural excess zeros beyond what NB2's own distribution predicts are explicitly named as a DIFFERENT problem this model does not solve: a zero-inflated or hurdle model is needed for that, and NB2 only handles the ordinary long-right-tail overdispersion that comes with moderately more zeros than Poisson, not a fundamentally separate zero-generating process.
When to use it
Consider it when
The outcome is a non-negative count and a Poisson regression fit shows evidence of overdispersion (variance exceeding the mean by more than sampling noise would explain, commonly flagged around a dispersion ratio above roughly 1.5).
Use caution when
The count data are actually underdispersed (variance below the mean; negative binomial offers nothing over Poisson in that case; consider a generalized Poisson or Conway-Maxwell-Poisson model), there are STRUCTURAL excess zeros beyond what NB2's own distribution predicts (a zero-inflated or hurdle model is needed), or observations are clustered/repeated without being modeled (a mixed-effects or GEE approach is needed instead).
Formulas and symbols
NB2 mean model (log link)
mu_i the expected count for row i, identical in form to Poisson regression's mean model.
NB2 variance function
alpha >= 0 the dispersion parameter; alpha -> 0 recovers the Poisson variance exactly.
Boundary-corrected likelihood-ratio test vs Poisson
Halved because alpha=0 sits on the boundary of the parameter space, making the naive chi-square-1 reference distribution incorrect.
Assumptions and checks
- Negative binomial regression expects a genuine count outcome (non-negative integers); non-integer values make the results approximate rather than exact.
In KernelStats: Checked directly: the card detects non-integer outcome values and flags it as a warning.
- If the data are not actually overdispersed relative to Poisson (variance not meaningfully larger than the mean), the extra dispersion parameter this model estimates buys nothing, and a more parsimonious Poisson regression gives essentially the same fit with one fewer parameter to interpret.
In KernelStats: Checked directly: a boundary-corrected likelihood-ratio test comparing the negative binomial fit against Poisson is reported on the card, with the estimated dispersion parameter alpha shown alongside it.
- Independence of observations. Negative binomial regression assumes rows are independent; grouped or repeated counts (clusters, subjects, sites measured more than once) understate the true standard errors.
In KernelStats: Not checked by KernelStats: stated directly as a standing 'Independence of observations' reminder; a clustered design needs an NB mixed model or GEE with a robust variance instead.
- An optimizer that does not report full convergence has not necessarily found the true maximum-likelihood estimate; this happens most often when the dispersion parameter is near 0 (the data are barely overdispersed), in which case the coefficients may differ meaningfully from a properly-converged Poisson fit on the same data.
In KernelStats: Checked directly: the card reports when the MLE optimizer did not report full convergence and recommends comparing against the Poisson fit.
Alternatives
- Poisson Regression. The overdispersion likelihood-ratio test shows alpha is not significantly different from zero: Poisson is adequate and more parsimonious.
Worked example
Scenario
Modeling annual customer store visits from age and membership tier, after a Poisson fit showed a dispersion ratio of 2.3.
Result
Negative binomial estimates alpha = 0.41 (SE 0.06); the boundary-corrected LR test against Poisson gives p < .001; IRR for membership tier = 1.34 (nearly identical to Poisson's 1.33), but the negative binomial's 95% CI [1.18, 1.52] is noticeably wider than Poisson's overly narrow [1.24, 1.44].
Interpretation
The strongly significant overdispersion test confirms negative binomial was the right choice here: the point estimate for membership tier's effect barely moved, but the corrected, wider confidence interval is the one that honestly reflects the real uncertainty in the data, exactly the pattern the method is designed to fix.
Common misconceptions
Misconception
If a Poisson regression's own p-values look fine (not obviously broken), overdispersion is probably not a problem.
Correction
Overdispersion specifically makes Poisson's standard errors TOO SMALL and its p-values TOO SMALL (too optimistic); you cannot detect this by simply eyeballing whether the Poisson fit's own p-values 'look reasonable'. A dedicated dispersion statistic or the boundary-corrected likelihood-ratio test against negative binomial is required to actually check.
Misconception
Switching from Poisson to negative binomial substantially changes the estimated effect sizes (IRRs).
Correction
The IRR point estimates from negative binomial are USUALLY CLOSE to what Poisson would have reported for the same data: the two models share essentially the same mean structure. What changes meaningfully is the STANDARD ERRORS (and therefore the confidence intervals and p-values), which widen appropriately once the model stops pretending the data are less variable than they really are.
References
- Regression Analysis of Count Data, Cameron, A. C. and Trivedi, P. K. (2013).
- Negative Binomial Regression, Hilbe, J. M. (2011).
