- Introduced by
- Hilbe, J. M.; Zeileis, A. et al.
- Year
- 2000s–2011
- Type
- Count regression with robust inference
- Family
- Regression / GLM
What does it do?
Robust Negative Binomial Regression models overdispersed count outcomes using the negative binomial distribution while protecting coefficient inference against misspecification of the variance function.
It pairs maximum-likelihood estimation of the mean and dispersion parameters with sandwich (Huber-White) standard errors, yielding valid tests even when the assumed variance structure is only approximately correct.
The intuition behind the method
Negative binomial regression extends Poisson regression by allowing the variance to exceed the mean — a common reality with count data such as emergency room visits or publication counts. Robustness is added at the inference stage: instead of trusting the model-based standard errors (which require the variance function to be exactly right), the analyst uses sandwich standard errors computed from the actual squared residuals. The result is coefficient estimates driven by the full likelihood but confidence intervals and p-values that are honest even under moderate model misspecification.
History
Negative binomial regression for counts is treated at length by Hilbe (2011). Zeileis, Kleiber and Jackman (2008) cover Poisson, geometric and negative binomial regression in R alongside hurdle and zero-inflated models. The robust variant applies the general sandwich-covariance construction to the negative binomial model.
When to use it
Use this model when the outcome is a non-negative integer count that is clearly overdispersed (the variance substantially exceeds the mean), a log-linear mean model is a reasonable description of the data, and you want coefficient inference that does not depend on the assumed variance function being exactly right. Dependence among observations, such as repeated measures within a group, is a typical reason to use the cluster-robust form, provided there are enough clusters for the sandwich estimator to be stable. Do not use it to handle excess zeros: when zeros outnumber what the negative binomial distribution accounts for, a hurdle or zero-inflated model addresses that structure directly, as Zeileis, Kleiber and Jackman (2008) discuss. Do not rely on it when the mean model is badly misspecified, or when unmodelled random effects drive the dependence, because sandwich corrections address variance misspecification only. If the data show no overdispersion, a Poisson model with robust standard errors may be simpler.
Limitations and considerations
- Sandwich standard errors are consistent only asymptotically; in small samples they can be poorly calibrated, and bias-corrected sandwich variants are worth comparing as a sensitivity check.
- The method corrects variance misspecification but cannot fix a misspecified mean function — if the log-linear mean model is wrong, coefficients will be biased.
- Estimating α alongside β increases the number of parameters and requires an adequately large sample relative to the number of predictors.
- Does not model structural zeros separately; severe zero-inflation still requires a zero-inflated negative binomial (ZINB) model.
- Robust standard errors can be less efficient than model-based ones when the negative binomial variance function is actually correct.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Accommodates overdispersed count data by explicitly modelling excess variance through the dispersion parameter α.
- Sandwich standard errors remain valid under moderate violations of the assumed variance function, reducing the risk of anti-conservative tests.
- Point estimates (coefficients) are identical to standard negative binomial MLE, so effect-size interpretation is unchanged.
- Only the standard-error step changes, so an existing negative binomial fit can be reported with sandwich inference without re-estimating the model.
- Preserves the interpretability of incidence-rate ratios (IRRs) from the log-link parameterisation.
Applications
- Modelling counts of hospital admissions, accident events, or disease episodes per patient when overdispersion is present.
- Analysing publication or citation counts in bibliometrics where variance far exceeds the mean.
- Epidemiological studies of rare events (crime incidence, adverse drug reactions) with potentially misspecified variance.
- Economics and social sciences: modelling the number of strikes, patent applications, or financial defaults.
- Ecology: species abundance counts exhibiting overdispersion across sampling units.
- Public health surveillance where count data arrive from heterogeneous populations with unknown clustering structure.
How it works
How it works
A log link connects the expected count μᵢ to a linear combination of predictors: log(μᵢ) = xᵢᵀβ. Exponentiating a coefficient exp(βⱼ) gives the multiplicative change in the expected count for a one-unit increase in predictor j.
Formula
\log(\mu_i) = \mathbf{x}_i^\top \boldsymbol{\beta}The negative binomial variance is Var(Yᵢ) = μᵢ + α·μᵢ², where the dispersion parameter α ≥ 0 is estimated from the data. When α = 0 the model reduces to Poisson; larger α captures greater overdispersion.
Formula
\mathrm{Var}(Y_i) = \mu_i + \alpha\,\mu_i^2All parameters (β and α) are estimated jointly by maximum likelihood. The log-likelihood of the negative binomial is maximised iteratively using Newton-Raphson or Fisher scoring, yielding the same point estimates as standard negative binomial regression.
The sandwich (Huber-White) covariance replaces the model-based information-matrix covariance. The outer 'bread' terms are the inverse of the weighted cross-product matrix XᵀWX, and the 'meat' sums squared residual-weighted outer products of the predictors, Σ ûᵢ² xᵢxᵢᵀ. Here ûᵢ is the residual for observation i that enters the meat. The residual type (for example score-based or Pearson-type) determines the finite-sample behaviour of the estimator, so the residual definition used by a given implementation should be checked in its documentation. Because the meat is built from observed residuals rather than the assumed variance, the covariance remains consistent when the true variance function departs from the negative binomial form, provided the mean model is correct.
Formula
\widehat{\mathrm{Var}}(\hat{\boldsymbol{\beta}}) = (X^\top W X)^{-1}\left(\sum_i \hat{u}_i^2 \mathbf{x}_i \mathbf{x}_i^\top\right)(X^\top W X)^{-1}Wald tests, likelihood-ratio tests, or robust score tests are used for individual coefficients and joint hypotheses. Sandwich-based Wald tests are asymptotically valid under variance misspecification when the mean model is correct and the sample is large enough; behaviour in small samples can differ, so sensitivity checks are advisable. Likelihood-ratio tests are built on the model-based likelihood and do not themselves incorporate the sandwich correction.
Common pitfalls
- Applying robust standard errors to compensate for severe zero-inflation or unmodelled random effects — these require structural solutions (ZINB or mixed effects NB), not variance corrections.
- Reporting model-based (information-matrix) standard errors alongside a claim of robustness — always specify which standard errors are used.
- Using cluster-robust standard errors when only a small number of clusters is available, where the sandwich estimator can be unreliable and small-cluster corrections or a mixed-effects model may be needed.
- Confusing overdispersion with outliers: a few extreme counts may call for a robust M-estimator for the regression coefficients themselves, not just robust standard errors.
- Neglecting to test for overdispersion before choosing NB over Poisson. A simple heuristic is to compare the Pearson chi-square statistic with its residual degrees of freedom; a ratio well above one suggests overdispersion relative to Poisson. If the data are not overdispersed, Robust Poisson with sandwich SEs may be preferable and simpler.
Frequently asked questions
How is Robust Negative Binomial Regression different from standard Negative Binomial Regression?
The coefficient estimates are identical. The only difference is in standard errors: the robust version uses sandwich (Huber-White) standard errors that remain valid when the assumed variance function is misspecified, whereas standard NB regression relies on model-based standard errors that are correct only if the full distributional assumptions hold.
When should I prefer Robust Poisson over Robust Negative Binomial Regression?
Robust Poisson regression (with sandwich SEs) is a popular choice for relative-risk estimation because the log-Poisson model with sandwich SEs is consistent for the mean even under overdispersion. Prefer the Robust NB model when the negative binomial variance function is approximately correct: NB is then typically more efficient than the Poisson-based approach, while the robust SEs still guard against residual variance misspecification. If overdispersion is mild or the NB variance structure is doubtful, the robust Poisson route is the safer choice.
What sample size is needed for the sandwich standard errors to be reliable?
There is no universal sample-size cut-off. Sandwich standard errors rely on large-sample approximations, so they can be unreliable when the sample is small or, for clustered data, when there are few clusters. In such settings, check results with bias-corrected sandwich variants and sensitivity analyses, and treat the robust intervals as approximate.
Does the dispersion parameter α have a direct interpretation?
Yes. In the NB2 parameterisation, Var(Y) = μ + α·μ². An α close to zero means the data are nearly Poisson; larger α indicates greater overdispersion. A likelihood-ratio comparison with Poisson (H₀: α = 0) is a common check. Because α = 0 lies on the boundary of the parameter space, the usual chi-square reference distribution is only approximate and tends to give conservative p-values, so a borderline result should be interpreted with care.
Can I use Robust Negative Binomial Regression with panel or clustered data?
Yes, but use cluster-robust standard errors rather than the ordinary (HC) sandwich estimator. Specify the clustering variable (e.g., subject or group id) so that the sandwich accounts for within-cluster correlation. If clustering is strong or the number of clusters is small, consider a mixed-effects negative binomial model instead, since the sandwich may then be unreliable.
Related methods
Sources
Hilbe, J. M. (2011). Negative Binomial Regression (2nd ed.). Cambridge University Press.
ISBN: 978-0521198158Zeileis, A., Kleiber, C., & Jackman, S. (2008). Regression Models for Count Data in R. Journal of Statistical Software, 27(8), 1–25.
Open DOI reference