Tutorials › Generalized Linear Mixed Models (GLMM) › Detecting Extra-Poisson Variation With Predictive Checks

Diagnostics and Predictive Checks for Sparse and Overdispersed Outcomes · Tutorial 627 of 698

Detecting Extra-Poisson Variation With Predictive Checks

Use model-replicated counts to assess whether a fitted Poisson GLMM reproduces variability both within and across clusters.

Intermediate 12 min read

What You'll Learn

  • Define extra-Poisson variation relative to a fitted GLMM’s conditional mean–variance assumption.
  • Construct observation-level and cluster-level variability summaries.
  • Compare observed summaries with distributions from model-replicated counts.
  • Interpret simulation-based tail proportions without treating them as calibrated hypothesis-test p-values.
  • Recognize when apparent overdispersion may instead reflect mean-model misspecification or cluster heterogeneity.
  • Identify practical limitations of predictive checks for sparse counts and small numbers of clusters.

Why Compare Observed and Replicated Variability?

A Poisson GLMM allows counts from the same cluster to be associated through shared random effects. That dependence can create substantial marginal variation across observations, even when the model assumes a Poisson distribution conditional on the random effects. The diagnostic question is therefore not simply whether the raw counts vary a great deal. It is whether the fitted model, including its random-effects structure, can generate variability like the variability seen in the data.

A predictive check addresses this by simulating count data under the fitted model and comparing selected summaries of those simulated data with the same summaries calculated from the observations. Here the focus is variation at two scales: individual observations and clusters. An unusually large observed variability summary can signal extra-Poisson variation not captured by the fitted GLMM, but it can also indicate a poor mean model, an incorrect random-effects structure, or an influential observation.

Definition: In a Poisson GLMM, write \(Y_{ij}\) for the count from observation \(i\) in cluster \(j\), and \(b_j\) for that cluster’s random effect. A common model is $$ Y_{ij}\mid b_j \ \text{independent}, \qquad Y_{ij}\mid b_j\sim\operatorname{Poisson}(\mu_{ij}(b_j)), \qquad \log\{\mu_{ij}(b_j)\}=o_{ij}+x_{ij}^{\mathsf T}\beta+z_{ij}^{\mathsf T}b_j. $$ Here \(o_{ij}\) is an offset, \(x_{ij}\) and \(z_{ij}\) are covariate vectors, and \(\beta\) and the random-effects distribution are estimated from the data. Conditional on \(b_j\), the Poisson assumption is \(\operatorname{Var}(Y_{ij}\mid b_j)=\mu_{ij}(b_j)\). Extra-Poisson variation means that the fitted model fails to account for observed variability at the scale being checked; it is not merely variation in raw counts across clusters.

A predictive check requires a correctly specified simulation target: hold the observed covariates, offsets, and cluster sizes fixed, then generate counts under the fitted model, using the model’s random-effects distribution when assessing variation across clusters. For each simulated data set, calculate the same diagnostic summary as for the observations. This comparison assumes that the conditional count distribution, fixed-effects mean structure, random-effects distribution, and dependence structure are reasonable representations of the data-generating process. In practice, the parameters are estimated, so the resulting comparison is a diagnostic reference rather than an exact, parameter-free test.

Summaries for Observation-Level and Cluster-Level Variation

One useful observation-level summary is the Pearson-type discrepancy $$ T_{\mathrm{obs}}=\sum_{j}\sum_i \frac{\{y_{ij}-\widehat{\mu}_{ij}\}^2}{\widehat{\mu}_{ij}}, $$ where \(\widehat{\mu}_{ij}\) is the fitted mean on the scale appropriate to the check. Large values indicate that squared deviations are large relative to the fitted means. For known Poisson means, each term has expectation one: since \(E(Y_{ij}-\mu_{ij})^2=\operatorname{Var}(Y_{ij})=\mu_{ij}\), it follows that \(E[(Y_{ij}-\mu_{ij})^2/\mu_{ij}]=1\). This gives the statistic an intuitive scale, but it does not mean that the statistic has a simple reference distribution in a fitted GLMM. Parameter estimation, sparse counts, and clustering all affect its distribution. The model-replicated distribution supplies a more relevant comparison.

A cluster-level summary can reveal whether clusters are more variable than the fitted model predicts. For example, let \(Y_j=\sum_i y_{ij}\) be the observed total in cluster \(j\), and let \(\widehat{m}_j\) be the model’s expected cluster total for the chosen prediction target. One simple summary is the sample variance of the centered totals \(Y_j-\widehat{m}_j\). Its units are squared counts. Calculate this same variance for each replicated data set; do not compare it with a generic cutoff that ignores the fitted model and cluster sizes.

The observed statistic is interpreted relative to the simulated values. If it lies near the upper end of the replicated distribution, the observed data are more variable than the fitted model commonly generates for that summary. A lower-tail discrepancy can instead indicate less variability than predicted. Neither result identifies a unique cause: a wrong mean structure can produce large residuals, and an inappropriate random-effects distribution can produce cluster-level mismatches.

Worked Example: An Observation-Level Variability Check

Suppose a hypothetical fitted Poisson model gives four fitted means of 1, 2, 3, and 4 counts, and the observed counts are 0, 5, 0, and 9. For this illustration, assume the four observations are conditionally independent under the fitted model, the offsets and covariates are correctly represented, and the fitted means are suitable for the intended check. The observed Pearson-type discrepancy is $$ T_{\mathrm{obs}} =\frac{(0-1)^2}{1}+\frac{(5-2)^2}{2} +\frac{(0-3)^2}{3}+\frac{(9-4)^2}{4} =1+4.5+3+6.25=14.75. $$

Now suppose 1,000 hypothetical data sets are generated under the fitted model, with the same four means, and the discrepancy is recalculated for each. Assume 18 of the 1,000 replicated discrepancies are at least 14.75, and the central 95% of replicated values runs from 1.1 to 12.9. The observed value is above that interval, and the simulated upper-tail proportion is \(18/1000=0.018\). This is evidence that the observed squared deviations are unusually large relative to this fitted model’s simulations. It is a diagnostic tail proportion, not the probability that the model is true or a calibrated hypothesis-test p-value.

The check also relies on the mean model: if a relevant covariate were omitted and the fitted means were systematically too low for some observations, the large discrepancy could reflect that misspecification rather than a separate count-dispersion mechanism.

Checking Variability Across Clusters

An observation-level summary can identify discrepancies within the collection of counts, but an across-cluster summary asks a distinct question: are cluster totals more dispersed than the fitted GLMM predicts? To make the comparison meaningful, the replicated data must reproduce the fitted model’s cluster-level variation as well as its conditional count variation. In particular, cluster sizes and predictors should match the observed design. A check based only on fitted cluster effects may not address the variability expected across new clusters; the simulation target must match the question being asked.

Worked Example: Comparing Cluster-Total Variation

Consider four hypothetical clusters with observed totals \(2, 11, 3,\) and \(10\). Suppose the fitted model predicts an expected total of 6.5 counts for each cluster. The centered totals are $$ 2-6.5=-4.5,\qquad 11-6.5=4.5,\qquad 3-6.5=-3.5,\qquad 10-6.5=3.5. $$ Their mean is zero. The sample variance is therefore $$ s^2_{\mathrm{cluster}} =\frac{(-4.5)^2+(4.5)^2+(-3.5)^2+(3.5)^2}{4-1} =\frac{20.25+20.25+12.25+12.25}{3} =21.67\ \text{counts}^2. $$

Suppose 1,000 data sets simulated under the fitted GLMM, preserving the observed cluster sizes and covariates and generating cluster effects from the fitted random-effects distribution, give a central 95% interval of 5.2 to 39.8 counts squared for this same statistic. The observed value, 21.67, lies within that interval. Although the four observed totals look spread out, this comparison does not suggest an unusually large cluster-total variance for the fitted model. The interval is a simulation reference for this specified fitted model and design, not a confidence interval for a population variance.

This check is conditional on the model being a credible description of expected cluster totals and cluster heterogeneity. With only four clusters, the comparison has limited ability to distinguish plausible variation from a misspecified random-effects distribution.

Worked Example: Reading Both Scales Together

A hypothetical data set has six observations in three clusters. The fitted means are \(0.5, 1, 1.5, 3, 2,\) and \(4\), and the observed counts are \(0, 1, 3, 8, 1,\) and \(9\), respectively. Assume the offsets and covariates have been checked, and that the fitted GLMM’s simulation scheme is appropriate for both summaries. The observation-level discrepancy is $$ T_{\mathrm{obs}} =\frac{(0-0.5)^2}{0.5}+\frac{(1-1)^2}{1} +\frac{(3-1.5)^2}{1.5}+\frac{(8-3)^2}{3} +\frac{(1-2)^2}{2}+\frac{(9-4)^2}{4} =0.5+0+1.5+8.333+0.5+6.25 =17.08. $$

The observed cluster totals are \(1, 11,\) and \(10\). The corresponding fitted expected totals are \(1.5, 7,\) and \(6\), so the centered totals are \(-0.5, 4,\) and \(4\). Their mean is 2.5, and their sample variance is $$ s^2_{\mathrm{cluster}} =\frac{(-0.5-2.5)^2+(4-2.5)^2+(4-2.5)^2}{3-1} =\frac{9+2.25+2.25}{2}=6.75\ \text{counts}^2. $$

Suppose the observation-level discrepancy is above the 97th percentile of its replicated values, while the cluster-total variance is near the middle of its replicated distribution. This pattern points to large observation-level deviations not accompanied by unusually dispersed cluster totals. It does not establish a particular cause, but it motivates checking which observations contribute most to the discrepancy and whether their fitted means or predictors are adequate. It would be inaccurate to conclude that the entire GLMM is wrong solely from one statistic, or that the model is adequate solely because the cluster-level statistic is typical.

Interpreting the Check and Its Limitations

Predictive checks complement residual plots and dispersion summaries rather than replacing them. A Pearson dispersion statistic compresses discrepancies into one number, while a predictive check compares that number—or another chosen summary—with variation expected under the fitted GLMM. Residual plots can help locate patterns by fitted value, covariate, or cluster; a single predictive statistic cannot show where a discrepancy occurs. Alternative count models may be considered if the discrepancy persists, but changing the model should follow investigation of mean structure, exposure, clustering, and influential observations.

Useful diagnostics include examining the simulated distribution of the chosen summary, identifying which observations or clusters dominate it, and checking whether the conclusion changes under a scientifically reasonable alternative summary. Sparse data make these checks especially sensitive to the chosen statistic: a few large counts can dominate a squared-residual measure, while many zero counts may require a summary that reflects the feature of concern. With few clusters, cluster-level variability is estimated imprecisely and the simulated reference may be broad. Plug-in parameter estimates can also make the simulated distribution too narrow if estimation uncertainty is substantial.

Common pitfall: “The observed counts vary more than their average, so the Poisson GLMM must be overdispersed.” This reasoning ignores both fitted means and cluster heterogeneity. The correction is to compare the observed variability summary with the distribution generated by the fitted GLMM under a clearly stated simulation target. A discrepancy signals a mismatch to investigate; it does not by itself identify the mechanism or prove that a specific alternative model is correct.

The central practical principle is to match the statistic to the scale of the concern. Use an observation-level summary to ask whether individual counts depart excessively from fitted means; use a cluster-level summary to ask whether cluster totals are more dispersed than the fitted model predicts. Report the summary, its units, the simulation scheme, and how extreme the observed value is among replicated values. That makes the conclusion interpretable and keeps a diagnostic comparison from being mistaken for a definitive test.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. For \(Y\mid b\sim\operatorname{Poisson}(\mu)\), why does \((Y-\mu)^2/\mu\) have expectation one?
  2. An observed cluster-variance summary is inside the central 95% of its replicated distribution. What can and cannot be concluded?
  3. Why should replicated data preserve the observed covariates and cluster sizes?
  4. A large observation-level discrepancy occurs, but the cluster-total discrepancy is typical. Give one cautious interpretation.

Solutions. (1) The Poisson variance is \(\mu\), so \(E[(Y-\mu)^2]/\mu=\operatorname{Var}(Y)/\mu=\mu/\mu=1\). (2) The observed summary is not unusually extreme relative to the specified fitted-model simulations; this does not prove that the model is correct. (3) The summaries depend on the design, including the fitted means and the number of observations contributing to each cluster, so changing those features would change the reference distribution. (4) The data may have large individual deviations without unusually dispersed cluster totals. This points toward inspecting observation-level fit and influential counts, but it does not identify a unique cause.

Clinical Biostats