Why Sparse GLMMs Need a Staged Check
When outcomes are sparse, an ordinary residual plot can be hard to interpret. Binary observations take only two values, and count data may contain many zeros and a few larger counts. Clustering adds another complication: observations from the same group are related, so a model can reproduce the overall event rate while missing important differences between groups. A useful diagnostic workflow therefore asks several focused questions rather than relying on one plot or summary.
The goal is not to prove that a model is correct. Diagnostics look for important discrepancies between the observed data and what the fitted model can plausibly generate. A model that passes a set of checks may still be wrong in ways those checks do not examine; a striking discrepancy, in turn, identifies something to investigate rather than automatically naming its cause.
The diagnostic interpretation depends on the assumptions used to fit the model. Check that the outcome distribution and link match the intended data structure, that offsets and denominators are correct, and that the random-effects structure represents the planned clustering or dependence. Unless additional dependence is modeled, clusters are ordinarily assumed independent conditional on the model. These assumptions should be reviewed before interpreting a residual pattern as evidence against the model.
A Staged Workflow
A practical workflow starts with errors that can be found without a residual plot, then moves from broad summaries to more targeted checks. At each stage, record the quantity being checked and the feature of the fitted model it is intended to assess.
Confirm the outcome coding, observation and cluster identifiers, denominators, exposures, missing-data handling, and any time or spatial ordering. Check that every row corresponds to the observational unit assumed by the model.
Check convergence messages, parameter estimates, boundary estimates, and whether the estimated covariance structure is interpretable. A diagnostic plot cannot repair a fit that did not converge or a model whose parameters are not identified well enough to support the intended conclusions.
Start with outcome totals, event or zero frequencies, and compact summaries of residuals. Interpret residual summaries cautiously: discreteness and sparsity limit what a smooth, symmetric pattern can reasonably look like.
Display cluster sizes and outcomes together, and compare within-cluster or ordered patterns with the model's expectations. A few influential-looking clusters or a systematic pattern over time can be obscured by an overall average.
Generate data under the fitted model and calculate the same summaries for each replicated data set. Check whether observed features, chosen in advance or motivated by the application, are unusual relative to their simulated distributions.
State what the checks covered, how replications were generated, what discrepancies appeared, and what remains unchecked. If a feature is poorly reproduced, investigate plausible model or data explanations and repeat relevant checks after any revision.
Why Simulate Replicated Data?
For discrete outcomes, residuals do not generally follow the familiar continuous, bell-shaped pattern. Simulation offers a direct way to ask whether a fitted model can reproduce a feature of interest. Let \(T(Y)\) be a summary, such as the number of zero counts or the largest cluster total. Generate \(B\) replicated data sets \(Y^{(1)},\ldots,Y^{(B)}\) under the fitted model and calculate \(T(Y^{(b)})\) for each one. Compare the observed \(T(y)\) with this simulated reference distribution.
The simulation scheme must match the question. A check of the observed clusters may retain the observed design and cluster sizes; a question about new clusters may require random effects to be drawn for those clusters. State whether simulations hold fitted random effects fixed or generate them from the fitted random-effects distribution. These choices target different replication settings, and neither should be left implicit.
A simulated percentile range is a descriptive reference, not automatically a confidence interval or a formal hypothesis test. If parameters are held at their estimates, the simulation reflects the fitted model at those values; uncertainty from estimating parameters is not fully represented. For a more uncertainty-aware assessment, a parametric bootstrap can simulate data and refit the model in each replicate, provided the fitting procedure is sufficiently stable. Whichever approach is used, explain it and avoid presenting a single simulated tail proportion as the probability that the model is true.
Worked Example: Checking Counts and Zeros Across Clusters
Suppose a hypothetical Poisson GLMM is fitted to 12 clusters, with one sparse count summary per cluster. The observed counts are \(0,0,0,0,0,0,0,1,1,1,2,3\). The observed total is $$ 0+0+0+0+0+0+0+1+1+1+2+3=8, $$ and 7 of the 12 clusters have zero counts.
For a diagnostic check, suppose 500 data sets are simulated using the fitted model and the same 12-cluster design. The simulated total-count distribution has a median of 10 and a 90% reference range from 5 to 17. The simulated number of zero-count clusters has a median of 8 and a 90% reference range from 6 to 10.
The observed total, 8 counts, lies within 5–17; the observed zero count, 7 clusters, lies within 6–10. These two summaries do not reveal a conspicuous discrepancy. They do not establish that the model is adequate: for example, the checks do not show whether counts are concentrated in particular clusters or whether a covariate pattern is missed. A next step is to compare cluster-level displays and other summaries relevant to the scientific design.
The check is meaningful only if the simulations reflect the intended replication scheme and preserve the observed design features being conditioned on. The result should be reported as a comparison with these simulations, not as proof that the Poisson GLMM is correct.
Cluster-Level Displays and Residual Summaries
Overall summaries are useful for screening, but can conceal localized lack of fit. Display outcomes by cluster alongside cluster size and relevant covariates. Depending on the design, useful summaries include event counts, event proportions, total counts, numbers of zeros, and residual summaries. When observations have an ordering such as time, inspect whether patterns occur in that order rather than treating every row as interchangeable.
For sparse outcomes, a cluster with no events is not by itself evidence of model failure. Its interpretation depends on the cluster size, covariates, fitted model, and how often similar clusters appear in replications. Likewise, a large observed count may be expected in a sufficiently large or high-risk cluster. The comparison should account for the design and model predictions, not just rank clusters by their raw outcomes.
Worked Example: Checking Binary Outcomes by Clinic
Consider a hypothetical binary-outcome GLMM with 10 clinics and 5 patients per clinic. The observed numbers of events are \(0,0,1,1,2,2,3,3,4,4\). Thus the observed event total is \(20\), and the overall observed proportion is \(20/50=0.400\). Two clinics have no events.
Suppose 500 replicated data sets under the fitted model produce a median total of 20 events, with a 90% reference range from 13 to 28. The number of event-free clinics has a simulated 90% reference range from 0 to 4. The observed total of 20 and the observed count of 2 event-free clinics both fall within their respective ranges.
This says the model can reproduce these two broad features in the stated simulation setting. It does not say the event probability is 0.400 for every patient or that the model captures every clinic-specific pattern. A clinic-level display remains important: if events are consistently too concentrated in a few clinics compared with replications, that pattern could warrant investigation even when the total and number of event-free clinics look ordinary.
Residual summaries should be treated as screening tools, not universal pass-fail thresholds. Their scale and distribution depend on the response type, fitted values, and whether the diagnostic conditions on estimated random effects or incorporates their distribution. A small overall average can coexist with systematic positive and negative patterns that cancel. Detailed residual definitions and specialized plots are useful, but no one residual summary replaces checks tailored to the design and outcome.
Worked Example: Following Up an Ordered Pattern
In a hypothetical study, each of 8 clusters is observed on 4 successive occasions. A display compares the observed mean outcome at each occasion with the mean across 500 replicated data sets. The observed-minus-replicated differences, in events per cluster, are \(0.1,-0.2,-0.3,0.8\) for occasions 1 through 4.
The first three differences are near zero, while the fourth is \(0.8\) events per cluster above the simulated mean. Suppose the pointwise 90% simulation ranges for these differences are \([-0.5,0.5]\), \([-0.6,0.6]\), \([-0.6,0.6]\), and \([-0.7,0.7]\), respectively. The fourth observed difference, \(0.8\), lies just beyond its stated range; the other three lie inside theirs.
This is a signal to investigate the late-occasion pattern, not a final verdict. Because four occasions were examined, a single pointwise range does not account for searching across occasions. The analyst should check the data and model specification, inspect whether the pattern is repeated across clusters, and consider a simulation summary of a prespecified whole-sequence feature. The result is expressed in events per cluster and does not establish a causal time effect.
Common Pitfalls and Alternatives
- Relying on an overall average. A model can reproduce the grand event rate while missing cluster heterogeneity, zero frequency, or an ordered pattern. Pair global summaries with displays tied to the study design.
- Treating a reference range as a pass-fail rule. A point outside a chosen range is a prompt for follow-up, not proof of model failure; a point inside is not proof of adequacy. The number and selection of checks matter.
- Simulating under an unstated scheme. Holding cluster effects fixed and drawing new cluster effects answer different questions. Report which was used and what population of replications it represents.
- Calling an unusual pattern its cause. A discrepancy could reflect data errors, a missing predictor, an unsuitable outcome distribution, dependence not represented by the model, or chance. Diagnostics identify patterns; subject-matter reasoning and further analysis are needed to distinguish explanations.
Residual plots and algebraic residual summaries are efficient for spotting local structure and are often easier to inspect repeatedly. Simulation-based checks are particularly helpful for sparse discrete outcomes because they compare a chosen feature with outcomes generated under the fitted model. Neither approach dominates in every setting: a residual plot can expose a pattern that an aggregate simulation statistic misses, while a simulation check can show whether an apparently unusual sparse-data feature is actually common under the model. Formal goodness-of-fit tests may provide a calibrated test for a defined null model and statistic, but a single test rarely diagnoses which model component needs attention. The staged workflow combines these approaches without treating any one as definitive.
The workflow also has limitations. Sparse data may provide little information for detecting misspecification, and estimated random-effects or covariance parameters can be unstable. Many checks create opportunities to notice chance extremes, while too few checks may overlook important structure. Simulation results depend on the fitted model and the chosen replication scheme; they are not independent evidence that the model is true. Record the checks performed and avoid implying that unexamined features have been validated.
Documenting the Diagnostic Conclusion
A concise report should identify the fitted model and data features checked; state how replicated data were generated, including treatment of cluster effects and whether the model was refitted; give the observed summaries and their simulated comparisons; describe any visible cluster or ordering patterns; and explain the follow-up. Use specific language such as “the observed zero count was within the simulated reference range” rather than “the model passed.” If a concern remains unresolved, state it explicitly.
Check Your Understanding
Answer each question, then compare your reasoning with the brief solutions.
- A simulated 90% reference range for the number of zero counts is 4 to 9, while the observed number is 8. What can and cannot be concluded?
- Why should a diagnostic report state whether simulated cluster effects were held fixed or redrawn?
- A model reproduces the overall event proportion but has substantially more event-free clusters in the observed data than in most replications. Why is the overall proportion insufficient?
- What does a discrepancy at one of several inspected occasions imply when the simulation ranges are pointwise?
Solutions. (1) The observed count is within this reference range, so that summary alone shows no conspicuous discrepancy; it does not establish overall model adequacy. (2) Those choices define different replication settings and can produce different reference distributions, so the reported check must make its target clear. (3) The overall proportion can conceal how events are distributed across clusters; the excess of event-free clusters is a distinct feature to investigate. (4) It is a follow-up signal, not a definitive failure, because pointwise ranges do not account for searching across occasions.