Skip to content
Celeus

Negative-binomial regression

Shown in the app as negbin_regression. Part of the method reference, under Regression.

When to use

Model a COUNT outcome when its variance exceeds its mean (overdispersion), relaxing Poisson's equal-mean-variance assumption.

What you provide

  • Outcome: one numeric column.
  • Predictors: one or more columns.

Options

Missing data

  • Complete case (listwise deletion)

Multiple comparisons

  • Not adjustable for this method. Where it makes post-hoc comparisons, the procedure applies its own correction.

Confidence level

Every interval in the result is reported at the level you choose:

  • 90%
  • 95%
  • 99%

Alternatives that take the same inputs:

Other methods under Regression:

Guides that discuss this method

How to read the output

Poisson and negative binomial regression model a count outcome, for example the number of days a pupil was absent or the number of breaks in a length of yarn, from one or more predictors. Only rows with a value for the outcome and every predictor are used, and the number of rows analysed is reported.

Coefficients and rate ratios. Each coefficient is on the log scale. Exponentiated, it is a rate ratio: for a numeric predictor, the multiplicative change in the expected count per one-unit increase; for a categorical predictor, the expected count in that category relative to the reference category, which is always the first category (an ordered category is compared with its first level too, never fitted as a polynomial trend). Each is adjusted for the other predictors. The headline result is the first predictor’s rate ratio with its confidence interval. Intervals are profile-likelihood intervals; you can choose a 90%, 95% or 99% level, and every interval in the result uses it.

Testing a whole predictor. A categorical predictor with three or more levels has several contrasts, so each predictor is also tested as a whole with a likelihood-ratio test, and the whole model is tested against a model with no predictors. Read the whole-predictor test before any single contrast.

Overdispersion and the negative binomial model. A Poisson model assumes the variance of the counts equals their mean. Counts often vary more than that, and then a Poisson model’s standard errors are too small and its p-values too optimistic. Celeus reports the residual deviance divided by its degrees of freedom; above 1.5, a working convention rather than a published cut-off, the Poisson result carries a warning and offers a one-click re-run as negative binomial regression. The negative binomial model estimates an extra dispersion parameter, theta (alpha = 1/theta), and its results include a likelihood-ratio test against the Poisson model. Its p-value is halved, because the Poisson model sits on the edge of the negative binomial family (Self and Liang, 1987). In that model each predictor’s test holds theta at its full-model value. When the data show no extra variation, theta keeps growing without settling; Celeus says so, and the Poisson model is then the simpler one to report.

Sources: Nelder JA, Wedderburn RWM (1972), Journal of the Royal Statistical Society, Series A 135(3):370-384, doi:10.2307/2344614. Hilbe JM (2011), Negative Binomial Regression, 2nd ed., Cambridge University Press, doi:10.1017/CBO9780511973420. Self SG, Liang K-Y (1987), Journal of the American Statistical Association 82(398):605-610, doi:10.1080/01621459.1987.10478472.

Worked examples

Celeus's result on a published or illustrative dataset, next to an independent computation and, where one exists, a published value. The data themselves are not reproduced here.

MASS::quine

  • Source: Published dataset distributed with an R package
  • Licence: MASS (GPL)
  • Reference: Quine (1975); Venables & Ripley (2002), Modern Applied Statistics with S, 4th ed. - the canonical worked negative-binomial (overdispersed count) example
QuantityCeleusIndependent computationPublished valueAgrees
Estimate-0.569372-0.569372-Yes
p-value0.000204580.00020458-Yes

datasets::warpbreaks (tension L only)

  • Source: Published dataset distributed with an R package
  • Licence: base R (GPL)
  • Reference: Tippett (1950), Technological Applications of Statistics; independent computation
QuantityCeleusIndependent computationPublished valueAgrees
Estimate-0.456627-0.456627-Yes
p-value0.008349610.00834961-Yes
Confidence interval-0.796543, -0.117106-0.796542, -0.117106-Yes
Effect size0.6334160.633416-Yes
Effect size confidence interval0.450885, 0.8894910.450885, 0.889491-Yes
Test statistic for each model term6.937796.93779-Yes
Whole-model likelihood-ratio statistic5.894435.89443-Yes
Negative-binomial dispersion parameter (theta)9.439949.43994-Yes
Likelihood-ratio statistic for the dispersion, negative binomial against Poisson42.00542.005-Yes
Number of observations1818-Yes

MASS::quine

  • Source: Published dataset distributed with an R package
  • Licence: MASS (GPL)
  • Reference: Quine (1975); Venables & Ripley (2002), Modern Applied Statistics with S, 4th ed.; independent computation
QuantityCeleusIndependent computationPublished valueAgrees
Estimate-0.569372-0.569372-Yes
p-value0.000204580.00020458-Yes
Confidence interval-0.829430, -0.310456-0.829429, -0.310456-Yes
Effect size0.5658810.565881-Yes
Effect size confidence interval0.436298, 0.7331120.436299, 0.733112-Yes
Test statistic for each model term13.05860, 0.25004, 11.97920, 2.5249813.05860, 0.25004, 11.97920, 2.52498-Yes
Whole-model likelihood-ratio statistic25.115925.1159-Yes
Negative-binomial dispersion parameter (theta)1.274891.27489-Yes
Likelihood-ratio statistic for the dispersion, negative binomial against Poisson1192.031192.03-Yes
Number of observations146146-Yes

ggplot2::txhousing

  • Source: Published dataset distributed with an R package
  • Licence: ggplot2 (MIT)
  • Reference: Texas A&M Real Estate Center, as shipped in ggplot2; independent computation
QuantityCeleusIndependent computationPublished valueAgrees
Estimate0.004146170.00414617-Yes
p-value0.1853320.185332-Yes
Confidence interval-0.00198351, 0.01027520-0.00198351, 0.01027520-Yes
Effect size1.004151.00415-Yes
Effect size confidence interval0.998018, 1.0103300.998018, 1.010330-Yes
Test statistic for each model term1.75771, 178.607001.75771, 178.60700-Yes
Whole-model likelihood-ratio statistic179.596179.596-Yes
Negative-binomial dispersion parameter (theta)0.6420250.642025-Yes
Likelihood-ratio statistic for the dispersion, negative binomial against Poisson86479008647900-Yes
Number of observations80348034-Yes

Validation report

References

  1. Hilbe, J. M. (2011). Negative Binomial Regression. Cambridge University Press, 2nd edition. doi:10.1017/CBO9780511973420 doi:10.1017/CBO9780511973420
  2. Self, S. G., Liang, K.-Y. (1987). Asymptotic properties of maximum likelihood estimators and likelihood ratio tests under nonstandard conditions. Journal of the American Statistical Association 82: 605-610. doi:10.1080/01621459.1987.10478472 doi:10.1080/01621459.1987.10478472
  3. Venables, W. N., Ripley, B. D. (2002). Modern Applied Statistics with S. Springer, New York, 4th edition.