Why Let Dispersion Depend on Covariates?
A negative-binomial model can accommodate count variability beyond the Poisson variance. But the amount of that extra variability need not be the same for every covariate pattern. For example, counts may be more heterogeneous in one setting than another, even after accounting for their different expected counts. A model with covariate-dependent dispersion represents this pattern directly rather than requiring one dispersion parameter for all observations.
The key distinction is between the dispersion parameter and the variance itself. In the NB2 parameterization, a constant dispersion parameter does not imply a constant excess-variance term: that term is the dispersion multiplied by the squared conditional mean, so it can vary as the mean varies.
Conditional NB2 Model and Its Dispersion Component
A common mean specification is \(\log(\mu_{ij})=x_{ij}^{T}\beta+u_{ij}^{T}b_i+\log(e_{ij})\), where \(x_{ij}\) are mean-model covariates, \(u_{ij}\) are random-effect covariates, and \(e_{ij}\) is an exposure when a rate model requires one. Typically \(b_i\sim N(0,\Sigma)\). The dispersion covariates \(q_{ij}\) need not be identical to the mean covariates \(x_{ij}\); they may overlap, differ, or include an intercept only. The exponential link guarantees \(\alpha_{ij}>0\).
The model assumes the specified conditional negative-binomial distribution is suitable and that observations are conditionally independent given the random effects and covariates. Random effects account for dependence and heterogeneity represented by the group structure; they do not remove the need to specify the conditional count variance appropriately. The dispersion model describes how the remaining NB2 dispersion changes across covariate patterns.
Why the Dispersion Link Is Log-Linear
One justification for the NB2 variance formula uses a Poisson count with a gamma-distributed latent rate. Conditional on \(b_i\), suppose \(\Lambda_{ij}\) has a gamma distribution with shape \(1/\alpha_{ij}\) and scale \(\alpha_{ij}\mu_{ij}\), and \(Y_{ij}\mid\Lambda_{ij},b_i\sim\operatorname{Poisson}(\Lambda_{ij})\). Then \(\operatorname{E}(\Lambda_{ij}\mid b_i)=\mu_{ij}\) and \(\operatorname{Var}(\Lambda_{ij}\mid b_i)=\alpha_{ij}\mu_{ij}^{2}\). Applying the law of total variance gives:
This derivation separates two sources of conditional variance: the Poisson contribution \(\mu_{ij}\) and the extra contribution \(\alpha_{ij}\mu_{ij}^{2}\). If \(\alpha_{ij}\) is constant, the latter can still change across observations because \(\mu_{ij}\) can change. A dispersion covariate changes \(\alpha_{ij}\), not automatically \(\mu_{ij}\). When a covariate appears in both models, it can affect both components.
For a one-unit increase in a dispersion covariate \(w\), with other dispersion predictors held fixed, its coefficient \(\gamma_w\) multiplies \(\alpha\) by \(\exp(\gamma_w)\). This is a ratio of dispersion parameters, not a ratio of variances. The variance also depends on the conditional mean.
Worked Example: Calculating Conditional Variance at Two Covariate Values
Suppose a hypothetical study uses \(\log(\alpha_{ij})=-2.303+0.4055w_{ij}\). For these calculations, hold the conditional mean at \(\mu_{ij}=4\) and compare \(w=0\) with \(w=1\). This isolates the dispersion-model contribution; it does not assert that the mean is constant in every application.
At \(w=0\), \(\alpha=\exp(-2.303)\approx0.0999585\). Therefore,
At \(w=1\), \(\alpha=\exp(-1.8975)\approx0.149943\), so
The dispersion ratio for a one-unit increase in \(w\) is \(\exp(0.4055)\approx1.500\). Thus, at this fixed conditional mean, the second covariate pattern has about 1.500 times the dispersion parameter and a larger conditional variance. The coefficient does not say that the variance itself is multiplied by 1.500: the Poisson contribution remains 4 here, and the extra-variance term is determined by \(16\alpha\).
Interpreting and Testing Dispersion Effects
A coefficient \(\gamma_w\) is interpreted on the log-dispersion scale. Its exponentiated value is the multiplicative change in \(\alpha\) for a one-unit increase in \(w\), conditional on the other predictors in the dispersion model. For a categorical covariate, it compares the dispersion parameter in the coded category with that in the reference category. A confidence interval for \(\gamma_w\) can be exponentiated endpoint by endpoint to give an interval for the dispersion ratio.
Inference commonly tests \(H_0:\gamma_w=0\), equivalent to a dispersion ratio of 1, against an alternative such as \(H_a:\gamma_w\ne0\). Wald inference uses the estimate divided by its standard error and relies on an approximate normal distribution. Likelihood-based comparisons can also be used when models are nested and the relevant regularity conditions are adequate. With few groups, sparse covariate patterns, or weakly identified dispersion effects, standard large-sample approximations may be unreliable.
Worked Example: Interpreting an Estimated Dispersion Ratio
In a hypothetical fitted model, the estimated coefficient for a binary setting indicator is \(\hat{\gamma}_w=0.405\), with \(SE=0.180\). Using a two-sided Wald test at \(\alpha=0.05\), calculate the test statistic, approximate p-value, and a 95% confidence interval.
The statistic is \(z=0.405/0.180=2.25\). Under the null hypothesis, the two-sided standard-normal p-value is approximately \(0.0244\), which is below \(0.05\). On these model-based assumptions, the data provide evidence that the dispersion parameter differs between settings.
The approximate interval on the log-dispersion scale is \(0.405\pm1.96(0.180)\), giving \((0.0522,0.7578)\). Exponentiating the estimate and both endpoints gives:
The estimated dispersion parameter is about 1.499 times as large in the indicator category as in the reference category, with an approximate 95% interval from 1.054 to 2.134 for that ratio. The interval excludes 1, consistent with the two-sided test at the 5% level. This is inference about \(\alpha\), not a claim that the variance ratio has the same value; the means in the two settings may differ.
Worked Example: Dispersion Changes Variance and Zero Probability Differently
Consider two hypothetical covariate patterns with the same conditional mean \(\mu=2\), and a dispersion model that gives \(\alpha=0.2\) in the first pattern and \(\alpha=0.6\) in the second. Calculate the conditional variance and the probability of zero under the NB2 model.
The variances are \(2+0.2(2^2)=2.800\) and \(2+0.6(2^2)=4.400\). For an NB2 count with mean \(\mu\) and dispersion \(\alpha\), the zero probability is \(P(Y=0\mid b)=(1+\alpha\mu)^{-1/\alpha}\). Thus, for the first pattern it is \(1.4^{-5}\approx0.1859\). For the second it is \(2.2^{-1/0.600}\approx0.2687\).
With the mean held fixed, the larger dispersion increases both the conditional variance and the model-implied probability of zero in this example. That fact alone does not establish a separate zero-generating mechanism: the probability follows from the fitted negative-binomial distribution. The example also shows why a dispersion coefficient should not be interpreted as a direct multiplier of every feature of the count distribution.
Checking the Model and Recognizing Its Limits
A varying-dispersion specification is useful only if its conditional distribution and predictor structure are credible. After fitting, examine residual or simulation-based diagnostics for systematic lack of fit, and compare observed and model-predicted variability across meaningful ranges or categories of the dispersion covariates. Also check whether the mean structure is adequate: a missing mean predictor can look like excess variability, while an omitted group structure can leave dependence unaccounted for. These checks should respect clustering rather than treating repeated observations as independent.
A constant-dispersion NB2 model is a simpler alternative when there is little evidence that \(\alpha\) changes with covariates. A Poisson model sets the extra-variance term to zero and is unsuitable when conditional overdispersion remains. A quasi-Poisson model allows a variance relationship but does not specify the same full negative-binomial likelihood. Random effects can represent structured heterogeneity and dependence; they are not interchangeable with an observation-level dispersion regression. Model choice should follow the data structure and scientific question, not just a search for the largest likelihood.
Dispersion regression also has limitations. Its estimates may be unstable when the sample is small, counts are sparse, or dispersion covariates have little variation. A linear predictor for log dispersion is a modeling assumption, not a guarantee that dispersion follows that pattern. More flexible specifications consume information and can be weakly identified, particularly if mean and dispersion predictors overlap. Finally, a conditional dispersion model describes variability after conditioning on the modeled effects; marginal variability also includes variation in the random effects.
Common Pitfalls
- Confusing constant dispersion with constant excess variance. Constant \(\alpha\) means the dispersion parameter is shared across observations. Since the excess-variance term is \(\alpha\mu^2\), it can differ when the means differ.
- Calling \(\exp(\gamma_w)\) a variance ratio. It is a dispersion ratio. A variance comparison must also account for the conditional means and the Poisson contribution.
- Ignoring the mean model. If a covariate affects both \(\mu\) and \(\alpha\), its effect on conditional variance includes both pathways. State which quantity is held fixed when interpreting a comparison.
- Confusing conditional and marginal variability. Conditional variance given random effects is not the same as variance after integrating over them; the latter also includes variation in the conditional mean.
For example, if \(b_i\) is random, the law of total variance gives \(\operatorname{Var}(Y_{ij})=\operatorname{E}\{\mu_{ij}+\alpha_{ij}\mu_{ij}^{2}\}+\operatorname{Var}(\mu_{ij})\), where expectations are over the random effects. Thus, a fitted dispersion model alone does not account for all marginal variation.
Choose the mean predictors, link, exposure treatment if needed, and random-effects structure.
Choose covariates \(q_{ij}\) and use \(\log(\alpha_{ij})=q_{ij}^{T}\gamma\) to keep dispersion positive.
Exponentiate a dispersion coefficient for a ratio of \(\alpha\), then calculate variances using the relevant conditional means.
Check conditional fit across dispersion covariates, evaluate the adequacy of large-sample inference, and distinguish conditional from marginal variation.
Check Your Understanding
Answer each question, then compare with the solution given immediately afterward.
- In the NB2 model, what does a constant \(\alpha\) imply, and what does it not imply?
Solution: It implies the same dispersion parameter across observations. It does not imply the same excess-variance term, because that term is \(\alpha\mu^2\) and can change with \(\mu\). - A dispersion coefficient is \(\gamma_w=-0.30\). What is the dispersion ratio for a one-unit increase in \(w\), and how should it be interpreted?
Solution: \(\exp(-0.30)\approx0.741\). Holding other dispersion predictors fixed, the dispersion parameter is about 0.741 times as large, or about 25.9% lower, for a one-unit increase in \(w\). This is not necessarily the variance ratio. - At a fixed conditional mean of 3, compare the NB2 variances for \(\alpha=0.1\) and \(\alpha=0.4\).
Solution: They are \(3+0.1(9)=3.900\) and \(3+0.4(9)=6.600\), respectively. The larger dispersion gives the larger conditional variance at this fixed mean. - Why can the marginal variance exceed the conditional variance in a GLMM?
Solution: Integrating over random effects adds variation in the conditional mean: \(\operatorname{Var}(Y)=\operatorname{E}\{\operatorname{Var}(Y\mid b)\}+\operatorname{Var}\{\operatorname{E}(Y\mid b)\}\). The second term is nonnegative. - Why does a higher fitted NB2 dispersion not, by itself, prove that a separate zero-generating mechanism is needed?
Solution: The NB2 distribution already implies a zero probability determined by its mean and dispersion. A larger dispersion can change that probability, so the observed zeros must be assessed against the fitted count distribution rather than treated as proof of another mechanism.