Tutorials › Generalized Linear Mixed Models (GLMM) › Separating Zero Inflation From Negative Binomial Dispersion

Overdispersion and Zero Inflation · Tutorial 552 of 698

Separating Zero Inflation From Negative Binomial Dispersion

Learn to distinguish excess zeros explained by negative-binomial dispersion from those implied by a structural-zero mixture, using probability and variance calculations.

Advanced 11 min read

What You'll Learn

  • State the negative-binomial and zero-inflated negative-binomial models and their assumptions.
  • Calculate zero probabilities under dispersion alone and under structural-zero mixing.
  • Derive the mixture mean and variance using conditional expectation and variance.
  • Compare models at a shared count-component mean and at matched marginal moments.
  • Recognize why a large observed zero fraction alone does not establish structural zeros.
  • Use model checks and predictive comparisons to identify when either explanation may be inadequate.

Why a Large Number of Zeros Does Not Identify Their Source

A count data set can contain many zeros for more than one reason. A negative-binomial distribution can assign substantial probability to zero because its dispersion allows more variability than a Poisson distribution. A zero-inflated model adds a different mechanism: some observations are in a structural-zero state, while the remaining observations follow a count distribution that can itself produce zeros. These mechanisms can both increase the zero probability, but they imply different probability models.

The distinction matters for interpretation. Negative-binomial dispersion describes variability in the count distribution; it does not, by itself, label any zero as structural. In a zero-inflated negative-binomial model, structural status is a latent mixture state, not something directly observed just because the count equals zero.

Definition: Use the negative-binomial parameterization \(Y\sim NB(\mu,k)\), where \(\mu>0\) is the mean and \(k>0\) is the size or dispersion parameter: $$ E(Y)=\mu,\qquad \operatorname{Var}(Y)=\mu+\frac{\mu^2}{k},\qquad P(Y=0)=\left(\frac{k}{k+\mu}\right)^k. $$ Smaller \(k\) means greater overdispersion relative to a Poisson distribution with the same mean. In a zero-inflated negative-binomial model, \(S\) is an indicator of structural-zero status, with \(P(S=1)=\pi\). If \(S=1\), \(Y=0\); if \(S=0\), \(Y\sim NB(\mu,k)\). Thus the negative-binomial count component can also produce sampling zeros.

In a GLMM, these formulas are understood conditional on the modeled covariates and any random effects. For observation \(i\), the count component may have mean \(\mu_i\), size \(k\), and structural-zero probability \(\pi_i\). If random effects are integrated out, the resulting marginal probabilities and variances also reflect variation from those effects; the conditional formulas should not be mistaken for marginal ones.

Probability and Variance Separate the Mechanisms

Under the negative-binomial model alone, every zero is generated by the count distribution. Its probability is \((k/(k+\mu))^k\). Under the mixture, a zero occurs either because the observation is structural, or because it is not structural and the negative-binomial count happens to be zero. These are disjoint routes to a zero.

$$ P(Y=0)=\pi+(1-\pi)\left(\frac{k}{k+\mu}\right)^k. $$

The mixture mean is reduced because structural-zero observations contribute nothing. Its variance has two parts: variation within the count component and variation between the structural and count states. The latter remains even if the count component itself were not highly dispersed.

$$ E(Y)=(1-\pi)\mu,\qquad \operatorname{Var}(Y)=(1-\pi)\left(\mu+\frac{\mu^2}{k}\right)+\pi(1-\pi)\mu^2. $$

A useful comparison is with a negative-binomial model having the same marginal mean \(m=(1-\pi)\mu\). If its size parameter is \(k_*\), then its variance is \(m+m^2/k_*\) and its zero probability is \((k_*/(k_*+m))^{k_*}\). Matching the mean does not force the two models to have the same variance or zero probability. Even matching both mean and variance does not, in general, make their zero probabilities equal.

Worked Comparisons

Worked Example: Negative-Binomial Dispersion Alone Produces Many Zeros

Suppose a hypothetical count has negative-binomial mean \(\mu=1.20\) and size \(k=2/3\). Compare its zero probability with that of a Poisson count with the same mean. There is no structural-zero component in either calculation.

The negative-binomial variance is $$ \operatorname{Var}(Y)=1.20+\frac{1.20^2}{2/3} =1.20+\frac{1.44}{0.6667}=3.36. $$ Thus the variance is substantially greater than the mean. Its zero probability is $$ P(Y=0)=\left(\frac{2/3}{2/3+1.20}\right)^{2/3} =\left(\frac{5}{14}\right)^{2/3}\approx 0.5034. $$ The Poisson zero probability is \(e^{-1.20}\approx0.3010\). Therefore, under these hypothetical parameters, negative-binomial dispersion alone raises the probability of a zero by about \(0.5034-0.3010=0.2024\), or 20.24 percentage points. This model attributes those zeros to the negative-binomial count distribution, not to a separate structural state.

Worked Example: Adding a Structural-Zero State

Keep the hypothetical negative-binomial count component from the preceding calculation: \(\mu=1.20\), \(k=2/3\), and count-component zero probability approximately \(0.50338\). Choose \(\pi\) so that the mixture's total zero probability is \(0.5500\). This is an illustrative parameter choice, not an estimate from data.

Solve the mixture zero-probability equation: $$ 0.5500=\pi+(1-\pi)(0.50338), \qquad \pi=\frac{0.5500-0.50338}{1-0.50338}\approx0.09387. $$ So about 9.387% of observations are assigned to the structural-zero state in this hypothetical model. The remaining observations still have a 0.50338 chance of a sampling zero. The mixture zero probability is \(0.5500\), which exceeds the negative-binomial-only probability by $$ 0.5500-0.50338=0.04662\approx0.0466. $$ The marginal mean is not 1.20: it is $$ E(Y)=(1-0.09387)(1.20)\approx1.087. $$ This distinction is essential: \(\mu\) is the mean conditional on being in the count component, while \(1.087\) is the mixture mean.

Worked Example: Comparing Zero Probabilities After Matching Mean and Variance

Consider a hypothetical zero-inflated negative-binomial model with \(\pi=0.20\), count-component mean \(\mu=2\), and size \(k=2\). Compare it with a negative-binomial model matched to the mixture's marginal mean and variance.

The count component has variance \(2+2^2/2=4\) and zero probability \((2/4)^2=0.25\). Therefore the mixture has $$ P(Y=0)=0.20+0.80(0.25)=0.400. $$ Its marginal mean and variance are $$ m=0.80(2)=1.60,\qquad v=0.80(4)+0.20(0.80)(2^2)=3.20+0.64=3.84. $$ For a negative-binomial model with mean \(m\) and variance \(v\), its size must satisfy \(v=m+m^2/k_*\). Hence $$ k_*=\frac{m^2}{v-m}=\frac{1.60^2}{3.84-1.60} =\frac{2.56}{2.24}=\frac{8}{7}. $$ The matched negative-binomial zero probability is $$ \left(\frac{8/7}{8/7+1.60}\right)^{8/7} =\left(\frac{5}{12}\right)^{8/7}\approx0.3677. $$ Thus, even with the same mean and variance, the mixture has a larger zero probability: \(0.400-0.3677=0.0323\). This difference illustrates that first and second moments do not fully determine the shape of a count distribution.

Why the Mixture Variance Has Two Contributions

The variance formula follows from conditioning on structural status. Given \(S=1\), the count is zero and has conditional mean and variance zero. Given \(S=0\), its conditional mean is \(\mu\) and its conditional variance is \(\mu+\mu^2/k\). The law of total variance states that \(\operatorname{Var}(Y)=E\{\operatorname{Var}(Y\mid S)\}+\operatorname{Var}\{E(Y\mid S)\}\).

$$ \begin{aligned} E\{\operatorname{Var}(Y\mid S)\} &=(1-\pi)\left(\mu+\frac{\mu^2}{k}\right),\\ \operatorname{Var}\{E(Y\mid S)\} &=\operatorname{Var}\{\mu I(S=0)\} =\mu^2\pi(1-\pi),\\ \operatorname{Var}(Y) &=(1-\pi)\left(\mu+\frac{\mu^2}{k}\right)+\mu^2\pi(1-\pi). \end{aligned} $$

The first term is the average within-state count variation. The second is between-state variation: some observations are assigned a mean of zero, while others are assigned a mean of \(\mu\). This derivation also shows why it is incorrect to treat \(\pi\) as merely another way to increase the negative-binomial size. The mixture changes the distribution through a distinct state assignment.

Model Checks, Alternatives, and Limitations

An observed zero fraction greater than a Poisson model predicts is not, by itself, evidence for structural zeros. A negative-binomial model may already predict many zeros, as the first example showed. The comparison must use the same covariate structure and a clearly specified mean scale; otherwise, apparent differences can reflect mismatched predictions rather than distinct zero-generating mechanisms.

Useful checks include comparing observed and model-predicted zero proportions across relevant covariate patterns, examining the distribution of positive counts, and checking whether the fitted model reproduces the overall count distribution. Predictive checks should consider both zeros and nonzero counts: a model can match the total number of zeros while misrepresenting the positive tail. A model with an implausible dispersion estimate, unstable estimates, or systematic residual patterns may be inadequate even if its aggregate zero prediction looks acceptable.

The main alternatives answer different modeling questions. A Poisson model has variance equal to its mean; it is a useful reference but may be too restrictive for overdispersed counts. A negative-binomial model adds dispersion while retaining one count-generating distribution for all observations. A zero-inflated negative-binomial model combines negative-binomial dispersion with a structural-zero state. The latter is more flexible, but the structural interpretation requires substantive justification; extra flexibility alone does not demonstrate that a real structural class exists.

These formulas are conditional statements for the specified mixture. In a GLMM, random effects can also induce extra marginal variation and change zero probabilities after integration. Consequently, conditional negative-binomial dispersion, structural-zero mixing, and random-effect heterogeneity should not be conflated. Nor can an individual zero be classified as structural from its observed value alone: both mixture routes produce \(Y=0\). Model choice should therefore combine the scientific meaning of the states with distributional checks and uncertainty in the fitted parameters.

Common pitfall: “There are more zeros than a Poisson model predicts, so the extra zeros must be structural.” This reasoning ignores negative-binomial dispersion, which can substantially increase the sampling-zero probability. First calculate or estimate what the negative-binomial model predicts; then assess whether a mixture is warranted using the full count distribution and the scientific interpretation of a structural state.

Check Your Understanding

Answer each question using the stated parameterization. Full solutions follow the questions.

  1. For \(Y\sim NB(1,1)\), calculate its variance and zero probability. What does this say about zeros without a structural-zero component?
  2. A zero-inflated model has \(\pi=0.10\), and its negative-binomial component has zero probability \(0.40\). Find the mixture zero probability.
  3. For a mixture with \(\pi=0.25\), count-component mean \(\mu=2\), and count-component variance \(5\), find the marginal mean and variance.
  4. Why does matching the marginal mean and variance of a zero-inflated model to a negative-binomial model not guarantee equal zero probabilities?

Solutions. (1) The variance is \(1+1^2/1=2\), and \(P(Y=0)=(1/(1+1))^1=0.500\). Half the probability is on zero despite there being no structural-zero state; this is dispersion in the count distribution. (2) \(P(Y=0)=0.10+0.90(0.40)=0.460\). (3) The mean is \((1-0.25)(2)=1.50\). The variance is \((0.75)(5)+(0.25)(0.75)(2^2)=3.75+0.75=4.50\). (4) The mean and variance summarize only the first two moments. Distinct distributions can share those moments but assign different probability to zero, as the third worked example demonstrates.

Clinical Biostats