Skip to main content

Negative Binomial regression

Negative Binomial (NegBin) is a count model that handles overdispersion — when the variance exceeds the mean, a very common situation that Poisson cannot describe correctly. NegBin adds a dispersion parameter α\alpha to relax the equidispersion constraint.

When to use

Use NegBin when YY is a count with overdispersion (Var(Y)>E[Y]\text{Var}(Y) > E[Y]). As α0\alpha \to 0, NegBin reduces to Poisson.


Model specification

E[YiXi]=μi=exp(Xiβ),Var(Yi)=μi+αμi2E[Y_i \mid X_i] = \mu_i = \exp(X_i \beta), \qquad \text{Var}(Y_i) = \mu_i + \alpha \, \mu_i^2

The parameter α>0\alpha > 0 measures overdispersion. Estimated by MLE.


Diagnostics

  • Test H0:α=0H_0: \alpha = 0 (NegBin vs Poisson): rejection ⇒ NegBin is more appropriate.
  • If excess zeros remain ⇒ ZINB.

Running in EcoLab

  1. Modeling module → Count data family → Negative Binomial.
  2. Select the count YY, the XX variables, an offset if needed.
  3. Run; read IRRs and α\alpha; compare AIC/BIC with Poisson; export the replication code.

Replication code

* ===== Negative Binomial Regression =====
* Estimate with robust standard errors
nbreg patents rd_spend firm_size, vce(robust)

* Incidence Rate Ratios (IRR)
nbreg patents rd_spend firm_size, vce(robust) irr

* Test alpha = 0 (NegBin vs Poisson)
* The LR test of alpha is shown at the bottom of output
* p < 0.05 ⇒ NegBin preferred over Poisson

* Compare AIC/BIC
estimates store nb
quietly poisson patents rd_spend firm_size, vce(robust)
estimates store pois
estimates stats pois nb

Limitations

  • Still poor when excess zeros arise from a separate mechanism ⇒ use zero-inflated.
  • Needs a large enough sample to estimate α\alpha stably.

Video tutorial

Video Tutorial: Guide to running Negative Binomial regression in EcoLab

See also