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%
Related methods
Alternatives that take the same inputs:
Other methods under Regression:
- Linear regression
- Logistic regression
- Firth penalised logistic regression
- Ordinal logistic regression
- Multinomial logistic regression
- Factors associated with outcome (continuous outcome)
- Factors associated with outcome (binary outcome)
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
| Quantity | Celeus | Independent computation | Published value | Agrees |
|---|---|---|---|---|
| Estimate | -0.569372 | -0.569372 | - | Yes |
| p-value | 0.00020458 | 0.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
| Quantity | Celeus | Independent computation | Published value | Agrees |
|---|---|---|---|---|
| Estimate | -0.456627 | -0.456627 | - | Yes |
| p-value | 0.00834961 | 0.00834961 | - | Yes |
| Confidence interval | -0.796543, -0.117106 | -0.796542, -0.117106 | - | Yes |
| Effect size | 0.633416 | 0.633416 | - | Yes |
| Effect size confidence interval | 0.450885, 0.889491 | 0.450885, 0.889491 | - | Yes |
| Test statistic for each model term | 6.93779 | 6.93779 | - | Yes |
| Whole-model likelihood-ratio statistic | 5.89443 | 5.89443 | - | Yes |
| Negative-binomial dispersion parameter (theta) | 9.43994 | 9.43994 | - | Yes |
| Likelihood-ratio statistic for the dispersion, negative binomial against Poisson | 42.005 | 42.005 | - | Yes |
| Number of observations | 18 | 18 | - | 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
| Quantity | Celeus | Independent computation | Published value | Agrees |
|---|---|---|---|---|
| Estimate | -0.569372 | -0.569372 | - | Yes |
| p-value | 0.00020458 | 0.00020458 | - | Yes |
| Confidence interval | -0.829430, -0.310456 | -0.829429, -0.310456 | - | Yes |
| Effect size | 0.565881 | 0.565881 | - | Yes |
| Effect size confidence interval | 0.436298, 0.733112 | 0.436299, 0.733112 | - | Yes |
| Test statistic for each model term | 13.05860, 0.25004, 11.97920, 2.52498 | 13.05860, 0.25004, 11.97920, 2.52498 | - | Yes |
| Whole-model likelihood-ratio statistic | 25.1159 | 25.1159 | - | Yes |
| Negative-binomial dispersion parameter (theta) | 1.27489 | 1.27489 | - | Yes |
| Likelihood-ratio statistic for the dispersion, negative binomial against Poisson | 1192.03 | 1192.03 | - | Yes |
| Number of observations | 146 | 146 | - | 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
| Quantity | Celeus | Independent computation | Published value | Agrees |
|---|---|---|---|---|
| Estimate | 0.00414617 | 0.00414617 | - | Yes |
| p-value | 0.185332 | 0.185332 | - | Yes |
| Confidence interval | -0.00198351, 0.01027520 | -0.00198351, 0.01027520 | - | Yes |
| Effect size | 1.00415 | 1.00415 | - | Yes |
| Effect size confidence interval | 0.998018, 1.010330 | 0.998018, 1.010330 | - | Yes |
| Test statistic for each model term | 1.75771, 178.60700 | 1.75771, 178.60700 | - | Yes |
| Whole-model likelihood-ratio statistic | 179.596 | 179.596 | - | Yes |
| Negative-binomial dispersion parameter (theta) | 0.642025 | 0.642025 | - | Yes |
| Likelihood-ratio statistic for the dispersion, negative binomial against Poisson | 8647900 | 8647900 | - | Yes |
| Number of observations | 8034 | 8034 | - | Yes |
References
- Hilbe, J. M. (2011). Negative Binomial Regression. Cambridge University Press, 2nd edition. doi:10.1017/CBO9780511973420 doi:10.1017/CBO9780511973420
- 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
- Venables, W. N., Ripley, B. D. (2002). Modern Applied Statistics with S. Springer, New York, 4th edition.