Why Look Beyond a Single Dispersion Ratio?
A Pearson dispersion ratio compresses many residuals into one number. That can be useful for detecting an overall discrepancy between observed variation and the model’s variance benchmark, but it does not show where the discrepancy occurs. A model may fit some regions well and poorly in others, or residuals may change systematically across time or a scientifically important subgroup. Positive and negative residual patterns can also cancel in an overall average.
Residual plots and grouped summaries add structure to the diagnosis. They can show whether residuals tend to be positive or negative at particular predictor values, whether squared residuals are unusually large in one stratum, or whether a sequence over time has a visible pattern. Such a pattern is evidence to investigate, not by itself a proof of a particular cause.
Residuals and Grouped Summaries
For observation \(i\), let \(Y_i\) be the response and \(\hat{\mu}_i\) its fitted mean. If the model’s variance function is \(V(\mu)\), the Pearson residual is \(r_i=(Y_i-\hat{\mu}_i)/\sqrt{V(\hat{\mu}_i)}\). For a Poisson count, \(V(\mu)=\mu\), so \(r_i=(Y_i-\hat{\mu}_i)/\sqrt{\hat{\mu}_i}\). For grouped binomial data, the variance benchmark must correspond to the response actually modeled; for example, if \(Y_i\) is a count of successes out of \(m_i\) trials, its binomial variance is \(m_i p_i(1-p_i)\), not just \(p_i(1-p_i)\). Exposure is likewise reflected in the fitted mean for a count, and hence in its residual denominator.
A group can be defined by a categorical predictor, a time period, or a chosen range of a continuous predictor. For a group \(G_g\) containing \(m_g\) observations, two simple summaries are the mean Pearson residual and the mean squared Pearson residual:
The sign of \(\bar r_g\) records the direction of the average discrepancy: positive values mean the responses tend to exceed their fitted means in that group, and negative values mean they tend to fall below them. The quantity \(q_g\) summarizes squared residual size relative to the model’s variance benchmark. It is not a pure measure of random spread: a nonzero group mean also contributes to it.
What the Summaries Mean Under the Model
An exact benchmark can be stated when the means are known. Let \(x\) denote the full collection of covariates, and suppose the group membership is fixed once \(x\) is given. Assume, for every observation, \(E[Y_i\mid x]=\mu_i\) and \(\operatorname{Var}(Y_i\mid x)=\phi V(\mu_i)\), where \(V(\mu_i)>0\) and \(\phi\) is the dispersion parameter. Define the oracle Pearson residual \(r_i=(Y_i-\mu_i)/\sqrt{V(\mu_i)}\), using these known means rather than estimated ones.
Proof. Since \(\mu_i\) and \(V(\mu_i)\) are fixed conditional on \(x\), linearity of conditional expectation gives, for each \(i\),
Averaging these expectations over the fixed members of \(G_g\) proves the first claim. For the second claim, the conditional second moment of each residual is
The middle equality uses \(E[Y_i\mid x]=\mu_i\). Averaging over \(G_g\) proves \(E[q_g\mid x]=\phi\). Neither calculation uses covariances between distinct observations, so independence is not needed. \(\square\)
These are benchmarks for residuals using known means, not exact claims about fitted Pearson residuals. In practice the means are estimated from the same responses, and fitting can constrain or alter residual patterns. The theorem therefore motivates the diagnostics but does not make a fitted-residual group summary an exact test with a universal reference distribution.
How Group Patterns Can Disappear in an Overall Summary
The arithmetic behind aggregation is important. If the groups partition the data, with \(n=\sum_g m_g\), the overall mean residual and mean squared residual are weighted averages of the group summaries:
Thus a large \(q_g\) in one group can be offset by a small \(q_g\) elsewhere. Signed group means can cancel even more directly. The next identity separates these two features within each group.
Derivation. Expand the square and use \(\sum_{i\in G_g}(r_i-\bar r_g)=0\):
Rearranging gives the stated identity. A group can therefore have a large \(q_g\) because its residuals vary widely around zero, because they have a substantial common direction, or both. Looking at \(\bar r_g\) alongside \(q_g\) helps distinguish these patterns. \(\square\)
Worked Examples
Worked Example: A Residual Trend Across Predictor Values
Suppose a Poisson model gives fitted means of 4 for six observations, ordered by an increasing continuous predictor. The observed counts are 2, 3, 2, 6, 5, and 6. Calculate the Pearson residuals, then summarize the first and last three observations.
For each observation, \(r_i=(Y_i-4)/\sqrt{4}=(Y_i-4)/2\). The residuals in order are \(-1,-0.5,-1,1,0.5,1\). The first group has mean residual \((-1-0.5-1)/3=-2.5/3\), approximately \(-0.833\). The second group has mean residual \((1+0.5+1)/3=2.5/3\), approximately \(0.833\).
The first group’s mean squared residual is \((1+0.25+1)/3=0.75\); the second group’s is also \((1+0.25+1)/3=0.75\). The overall mean residual is zero, and the overall mean squared residual is \(0.75\). So the squared residual summaries do not distinguish the two halves, but the ordered signs reveal a clear transition from mostly below to mostly above the fitted means. A plot against the predictor would make that directional pattern visible. It is a reason to investigate the model’s fit across the predictor, not a conclusion about why the pattern occurred.
Worked Example: A High-Variation Stratum Hidden by Pooling
Consider four Poisson observations with known fitted means equal to 1. Two belong to stratum A and have observed counts 1 and 3; two belong to stratum B and have counts 1 and 1. Compute the residual summaries.
Since \(r_i=(Y_i-1)/\sqrt{1}=Y_i-1\), the residuals are 0 and 2 in A, and 0 and 0 in B. Thus \(\bar r_A=(0+2)/2=1\) and \(q_A=(0^2+2^2)/2=2\). In B, \(\bar r_B=0\) and \(q_B=0\). Across all four observations, \(\bar r=(0+2+0+0)/4=0.5\) and \(q=(0+4+0+0)/4=1\).
The overall mean squared residual equals 1, the Poisson benchmark for the mean squared oracle Pearson residual under this model. Yet the strata look quite different in this realization: A has both a positive average residual and a larger squared residual summary, while B has no residual variation. The calculation illustrates why a pooled summary cannot identify which strata contribute to the observed pattern. It does not establish that stratum A has a different underlying variance; these are only four observations.
Worked Example: Comparing Residuals Across Time Periods
A Poisson model predicts a mean count of 4 at each of six successive times. The counts observed are 2, 3, 2, 6, 5, and 6. Compare the first three times with the last three.
As in the first example, the Pearson residuals are \(-1,-0.5,-1,1,0.5,1\). The mean residual is \(-0.833\) in the first period and \(0.833\) in the second. Each period has \(q_g=0.75\), and the overall mean squared residual is \(0.75\). The sequence of signs, however, runs from three negative residuals to three positive residuals.
A time-ordered residual plot preserves that order, while a single dispersion summary does not. The pattern may prompt closer examination of how the mean predictions behave over time, or whether the data collection and timing are represented appropriately. A residual pattern alone does not identify its source, and consecutive observations should not automatically be treated as independent evidence.
Choosing Groups and Reading Plots
For a continuous predictor, plotting residuals against the predictor retains individual detail. A smooth curve can help reveal broad changes in the residual center; bins can make group means and squared residual summaries easier to compare. Bin boundaries and sizes affect the picture, so report them and avoid trying many cut points until one appears striking. A plot against fitted means answers a related but different question: plotting against the original predictor can expose a pattern tied to predictor values even when the fitted means do not make it visually obvious.
For categorical predictors or scientifically meaningful strata, show the number of observations in each group along with its residual summaries. A striking average based on a very small group is uncertain. For time, preserve the natural ordering rather than sorting residuals by magnitude. When feasible, show both the residual values and a summary, since different sequences can share the same group mean and mean square.
A useful diagnostic workflow is:
Use a covariate, time scale, or scientific stratum that is relevant to the study question.
Inspect residual signs and magnitudes, and report group sizes, mean residuals, and squared-residual summaries where useful.
Ask whether a localized pattern is concealed by pooling, and whether it persists across reasonable, prespecified summaries.
Describe the observed pattern without treating a plot or grouped summary as proof of its cause.
Common Mistakes and Practical Cautions
- Assuming a pooled ratio rules out local problems. A single average can obscure contrasts among groups or a sequence of residual signs. Inspect interpretable groupings as well as the overall statistic.
- Treating fitted-residual identities as exact. The conditional expectations proved above use known means and assumptions conditional on the full covariate collection. Estimated means do not automatically satisfy those same identities.
- Calling every large group mean overdispersion. A nonzero mean residual points to directional discrepancy; a large squared-residual summary can reflect that direction as well as within-group variation. Report both when interpreting a group.
- Using the wrong variance denominator. The Pearson residual must use the variance of the modeled response, including the number of binomial trials or the fitted count mean that incorporates exposure.
- Overinterpreting a convenient cut point. Searching across many groupings can produce an apparently unusual summary by chance. Give priority to groupings justified by the study design or scientific question, and treat exploratory patterns as exploratory.
These diagnostics matter because they turn a global lack-of-fit signal into a location-specific question: which predictor values, times, or strata deserve closer scrutiny? They can also reveal patterns even when the overall squared-residual average looks ordinary. The appropriate conclusion is usually a concrete description of the pattern and a clear statement of uncertainty, not an immediate claim that one particular mechanism has been identified.
Check Your Understanding
Use the definitions and reasoning in this tutorial to answer the following questions.
- What is the difference between a group’s mean Pearson residual and its mean squared Pearson residual?
- Why do the conditional expectations for the oracle grouped summaries require assumptions conditional on the full covariate collection?
- How can a group with a large mean squared residual contribute to an ordinary-looking overall mean squared residual?
- Why should time-ordered residuals be plotted in their original order rather than sorted by size?
- For a grouped binomial response recorded as a success count out of \(m_i\) trials, what variance belongs in the Pearson residual denominator?