Why Compare Conditional Variance With Conditional Mean?
A response distribution determines more than the possible values of an outcome and its mean. It also imposes a relationship between the mean and variance. That relationship can be a useful diagnostic: if the observed variation is persistently inconsistent with the candidate family’s prediction, the family may not describe the response process adequately.
In a generalized linear mixed model, the relevant comparison is usually conditional. The conditional mean and variance describe the response after conditioning on the covariates and the cluster-specific random effects. A mismatch is a signal to investigate, not a verdict: it may reflect the response distribution, but it may also arise from an inadequate mean model, missing heterogeneity, or dependence not represented by the model.
For example, a Poisson response has conditional variance equal to its conditional mean. A binomial count with \(n_{ij}\) trials and success probability \(p_{ij}\) has conditional mean \(n_{ij}p_{ij}\) and conditional variance \(n_{ij}p_{ij}(1-p_{ij})\). Therefore, a general variance specification cannot always be expressed as a function of the mean alone: known parameters such as the trial count may also be required.
What a Variance Mismatch Does—and Does Not—Show
A variance comparison is meaningful only relative to a specified conditioning set and a credible mean model. In a GLMM, that means asking whether the candidate family’s conditional variance matches variation among responses with comparable covariates and cluster effects. In practice, the random effects are estimated rather than observed, so this comparison is a model diagnostic, not a direct reading of known conditional quantities.
The response’s support is a separate constraint. A binomial count cannot exceed its trial count, while an ordinary Poisson count has no fixed upper bound. An apparent variance match does not make a family plausible if its possible values conflict with how the response was measured. Likewise, a numeric score for ordered categories does not automatically make variance-versus-mean comparisons meaningful: the numerical distances between categories may not represent equal increments.
The central caution is that conditional and marginal variation are not the same. Marginal variation averages over the random effects, which can vary across clusters. Consequently, a marginal variance larger than the marginal mean does not, by itself, contradict a conditionally Poisson model.
Identify the response support, covariates, cluster effects, and any known design quantities such as a trial count or observation window.
Use its full conditional variance, including design parameters where needed; do not assume variance is determined by the mean alone.
Compare observed response variation with the family’s conditional prediction across observations or groups with similar fitted conditions.
Check the mean specification, random-effects structure, dependence, and measurement process before attributing a mismatch to the response family.
Worked Examples
Worked Example: Comparing Counts With a Poisson Variance
Suppose a hypothetical analysis has two sets of five conditionally comparable count observations. Treat the fitted conditional means as fixed at 2 for set A and 4 for set B. The observed counts are A: \(0,1,2,3,4\), and B: \(1,2,4,5,8\). Assume the candidate model assigns independent Poisson responses within each set. The values are nonnegative counts, as required for this family, and the comparison is within sets having the same fitted conditional mean.
For set A, the sample mean is \(\bar{y}_A=(0+1+2+3+4)/5=2\). The sum of squared deviations from 2 is \(4+1+0+1+4=10\), so the sample variance is \(s_A^2=10/(5-1)=2.50\). A Poisson model with conditional mean 2 predicts conditional variance 2.
For set B, \(\bar{y}_B=(1+2+4+5+8)/5=4\). The squared deviations from 4 sum to \(9+4+0+1+16=30\), giving \(s_B^2=30/(5-1)=7.50\). A Poisson model with conditional mean 4 predicts conditional variance 4.
Both sample variances exceed the corresponding Poisson predictions. This is a reason to investigate the candidate model, not enough evidence to declare it false: each variance estimate uses only five observations, and the means or cluster effects would ordinarily be estimated. The pattern could also arise from an inadequate mean model or unaccounted-for heterogeneity.
Worked Example: Why a Binomial Trial Count Matters
Consider two hypothetical binomial response settings. In setting A, each response is the number of successes in \(n=4\) trials, with \(p=0.50\). In setting B, it is the number of successes in \(n=8\) trials, with \(p=0.25\). Both settings have conditional mean 2, but the trial counts differ.
For A, \(\mu=np=4(0.50)=2\), and \( \operatorname{Var}(Y)=np(1-p)=4(0.50)(0.50)=1.00.\)
For B, \(\mu=np=8(0.25)=2\), and \( \operatorname{Var}(Y)=np(1-p)=8(0.25)(0.75)=1.50.\)
The conditional means are equal but the predicted variances are not. Using only a mean-to-variance rule that ignores \(n\) would miss this difference. The correct comparison uses each observation’s trial count and its implied success probability; it also respects the different supports, 0 through 4 and 0 through 8.
Worked Example: Marginal Overdispersion From Cluster Heterogeneity
Suppose, hypothetically, that responses follow a Poisson distribution conditional on cluster intensity: \(Y_{ij}\mid \lambda_j\sim\operatorname{Poisson}(\lambda_j)\). Half of the clusters have \(\lambda_j=1\), and half have \(\lambda_j=3\). Within a cluster, the conditional mean and variance are both \(\lambda_j\).
Across clusters, \(E(\lambda_j)=0.5(1)+0.5(3)=2\). The variance of the cluster intensities is \(0.5(1-2)^2+0.5(3-2)^2=1\).
Applying the law of total variance gives \( \operatorname{Var}(Y)=E\{\operatorname{Var}(Y\mid\lambda_j)\}+\operatorname{Var}\{E(Y\mid\lambda_j)\}=E(\lambda_j)+\operatorname{Var}(\lambda_j)=2+1=3.\)
The marginal mean is 2 and the marginal variance is 3, yet the conditional Poisson variance relationship holds in every cluster. A marginal comparison alone would therefore mistake cluster heterogeneity for a failure of the conditional family.
A Short Justification for Residual-Variance Checks
Why can squared deviations help assess a variance relationship? Suppose the candidate conditional mean \(\mu_{ij}\) is correct and treated as fixed for the argument. For one observation, expand the squared deviation around its conditional mean:
The last equality follows because the mean is correctly specified, so the second term is zero. Thus, under the candidate family, the expected squared conditional deviation follows its stated conditional variance. If the mean is wrong, that extra squared-bias term is positive and can look like excess variation. In actual fitted GLMMs, means and random effects are estimated, and residuals may have different precision; raw sample variances are therefore screening evidence, not a complete formal test.
Diagnostics, Alternatives, and Limitations
When the observed variation appears inconsistent with a candidate variance relationship, first check whether the comparison is on the right scale. Observations with different fitted means or different binomial trial counts should not be treated as if they had identical variance predictions. Then examine whether the mean model captures relevant covariate patterns and whether cluster-level or other dependence is adequately represented.
Several approaches address different possible sources of a mismatch. They are not interchangeable:
| Possible issue | What to examine | Why it matters |
|---|---|---|
| Incorrect mean specification | Residual patterns by covariate and fitted mean | A mean error can inflate squared residuals even when the response family is suitable. |
| Uncaptured cluster heterogeneity | Variation across clusters and the assumed random-effects structure | Mixing over cluster effects can increase marginal variance and induce dependence. |
| Wrong response distribution | Support and conditional variance predicted by the family | A family may fail to represent the conditional response process despite an adequate mean model. |
| Dependence not represented in the model | Residual association by cluster, time, or measurement order | Dependence can change the uncertainty and apparent variation without being fixed by choosing a different one-observation distribution. |
A variance adjustment can sometimes improve uncertainty estimates without specifying a new full response likelihood. A different likelihood family instead makes a stronger distributional claim, including assumptions about possible responses and probabilities. The choice depends on the scientific response process and the inferential goal; a variance mismatch alone does not determine which alternative is appropriate.
There are practical limitations. Small groups provide noisy variance estimates. Fitted conditional means and random effects are uncertain, and grouping observations by estimated means can blur real differences. Extreme counts can dominate squared-residual summaries. Finally, a variance pattern may be compatible with several explanations, so diagnostics should be considered alongside support, the data-collection process, and the model’s conditional-independence assumptions.
Common Mistakes
- Using variance as a function of the mean alone in every family. For a binomial count, the trial number is also needed; equal means with different trial counts can have different variances.
- Comparing a marginal variance directly with a conditional rule. Variation in random effects contributes to marginal variance, as the total-variance decomposition shows.
- Treating a mismatch as proof of a wrong family. An incorrect mean model, omitted heterogeneity, or dependence can produce a similar residual pattern.
- Assuming that an ordinal score has a meaningful variance-mean relationship. The numeric labels for categories may not encode meaningful distances.
Check Your Understanding
Answer each question, then compare with the solutions below.
- A Poisson GLMM has conditional mean 5 for a response. What conditional variance does the family predict?
- Two binomial counts both have conditional mean 3. One has \(n=6\), the other \(n=12\). Calculate each variance using the binomial mean-variance expression, assuming both are valid binomial settings.
- Why does a marginal variance above the marginal mean not by itself disprove a conditional Poisson model?
- Give one reason, other than a wrong response family, why observed squared residuals might exceed the candidate family’s prediction.
Solutions. (1) A Poisson response has conditional variance equal to its conditional mean, so the predicted variance is 5. (2) For \(n=6\), \(\operatorname{Var}(Y)=3(1-3/6)=1.50\). For \(n=12\), \(\operatorname{Var}(Y)=3(1-3/12)=2.25\). The same mean does not imply the same variance when the trial count differs. (3) Random effects can make conditional means vary across clusters; the law of total variance adds that between-cluster variation to the average conditional variance. (4) For example, a missing covariate or an inadequate mean specification can create systematic residual deviations, increasing their squares even if the response family is otherwise suitable.