Why Count-Data Residual Plots Look Different
A residual plot for a Poisson generalized linear model does not usually look like a cloud of continuously scattered points. The response is a nonnegative integer, so at any fixed fitted mean only particular residual values are possible. At small fitted means, counts such as zero and one may be common, and the points can form a few prominent bands. These bands are often an expected consequence of the response scale, not evidence by themselves that the model is wrong.
The diagnostic question is whether the residuals show systematic structure beyond that discreteness. For example, do residuals tend to be negative at low values of a predictor and positive at high values? Do observed counts repeatedly exceed fitted means in one region? Such structure may indicate that the model's mean relationship is inadequate. A few separated horizontal bands, without a systematic trend, are not enough to reach that conclusion.
These formulas are for a Poisson response with a fitted mean. They do not turn integer counts into continuous observations: a given \(y_i\) and \(\hat{\mu}_i\) determine a single residual value. In a plot, observations with similar fitted means therefore tend to occupy similar bands. Pearson and deviance residuals transform the vertical scale differently, but neither removes the discreteness.
What the Discrete Bands and Boundaries Mean
For a fixed fitted mean \(\hat{\mu}\), the possible observed counts are \(0,1,2,\ldots\). The raw residuals are consequently \(-\hat{\mu},1-\hat{\mu},2-\hat{\mu},\ldots\), a discrete sequence with spacing one. The Pearson residuals have spacing \(1/\sqrt{\hat{\mu}}\), since increasing the count by one increases the numerator by one while the denominator stays fixed.
The lowest possible count is zero. Thus, at a fixed fitted mean, the lowest raw residual is \(-\hat{\mu}\), the lowest Pearson residual is \(-\sqrt{\hat{\mu}}\), and the lowest deviance residual is \(-\sqrt{2\hat{\mu}}\). These are lower boundaries, not symmetric limits. There is no finite upper boundary for an unrestricted Poisson count: larger counts produce larger positive residuals. In an observed plot, the largest count may of course be limited by the particular data set.
The boundaries depend on the fitted mean. Across a range of fitted means, the lower boundary moves, so a plot can have a curved envelope rather than a single straight lower edge. At small means, many observations may be zero, causing points to lie on or near the lower boundary. This can look visually striking while still being compatible with the count scale. The diagnostic issue is whether the observed positions, considered across predictor values or fitted means, depart from what the model's mean structure can reasonably explain.
Worked Example: Reading Residual Bands at One Fitted Mean
A hypothetical Poisson model predicts a mean of \(\hat{\mu}=2\) claim events for each of four policy groups with otherwise comparable covariates. Their observed counts are 0, 1, 2, and 4. Calculate the Pearson and deviance residuals and explain what their pattern shows.
Method. Substitute each observed count into the Poisson residual formulas. The comparison is made at the same fitted mean, so the possible residuals correspond directly to different integer counts.
For \(y=0\), the Pearson residual is \((0-2)/\sqrt{2}=-1.414\). For the deviance residual, the zero-count convention gives \(2\{0\log(0/2)-(0-2)\}=2(2)=4\), so the signed residual is \(-\sqrt{4}=-2.000\).
For \(y=1\), the Pearson residual is \((1-2)/\sqrt{2}=-0.707\). The deviance quantity inside the square root is \(2\{1\log(1/2)-(1-2)\}=2\{-0.6931+1\}=0.6137\). The residual is therefore \(-\sqrt{0.6137}=-0.783\).
For \(y=2\), both residuals are zero because the observed count equals the fitted mean.
For \(y=4\), the Pearson residual is \((4-2)/\sqrt{2}=1.414\). The deviance quantity is \(2\{4\log(4/2)-(4-2)\}=2\{4(0.6931)-2\}=1.5452\), giving a deviance residual of \(+\sqrt{1.5452}=1.243\).
Rounded to three decimals, the Pearson residuals are \(-1.414,-0.707,0,1.414\), and the deviance residuals are \(-2.000,-0.783,0,1.243\). Both sets are discrete values, not a continuous cloud. Their separation alone does not show a poor mean model; these four groups share the same fitted mean and do not establish a trend across a predictor.
Check. The signs match the comparisons with 2: counts 0 and 1 are below it, 2 equals it, and 4 exceeds it. The common mistake is to treat the visible gaps between these values as model failure; the integer response itself creates those gaps.
Why the Residual Values Are Discrete
The discreteness follows directly from the formulas. Once the fitted mean is fixed, the only changing input is the observed count \(y\), which can take only nonnegative integer values. For example, the Pearson residual is a fixed rescaling of \(y-\hat{\mu}\). Its values must therefore occur at integer-spaced steps on the original count scale, rescaled by \(1/\sqrt{\hat{\mu}}\).
There is also a useful reason the Pearson residual is centered at zero under a correct Poisson mean model. Conditional on the predictors, suppose \(Y\) has a Poisson distribution with mean \(\mu\). Then \(E[Y\mid x]=\mu\) and \(\operatorname{Var}(Y\mid x)=\mu\). Treating \(\mu\) as fixed for this justification,
This explains why a persistent positive or negative average residual in a region can be concerning: it suggests the observed counts in that region systematically exceed or fall below the model's means. It does not imply that every small group must have average residual exactly zero. Random variation, small group sizes, and parameter estimation all matter. A residual plot is a diagnostic, not a proof that the model is correct or incorrect.
Confirm that the response is a count and note whether the plot uses raw, Pearson, or deviance residuals. The scales have different boundaries.
At similar fitted means, repeated residual values or separated horizontal bands can follow naturally from integer outcomes.
Check whether residual signs or sizes change systematically with a predictor or fitted mean, rather than merely repeating at discrete levels.
When the plot is crowded, compare average residuals across ordered groups. Treat a pattern as evidence to investigate, not as a formal conclusion by itself.
Distinguishing Bands From a Mean-Pattern Problem
A plot against a predictor or fitted mean asks whether the model's expected count changes appropriately across that horizontal axis. A typical warning is a sustained sequence of negative residuals followed by positive residuals, or a curved pattern in which residuals are mostly negative at both ends and positive in the middle. Either can suggest the fitted mean relationship is missing a trend or curvature. By contrast, points appearing in only a few bands at each horizontal position may simply reflect the set of possible counts.
A simple way to make the distinction more visible is to group observations into ordered predictor ranges and calculate the mean residual within each group. If those means tend to rise steadily from negative to positive, that is more suggestive of a systematic mean discrepancy than the presence of bands alone. Grouping is only a visual summary: it can hide patterns within a group, and small groups can be noisy. It should complement, not replace, inspection of the individual observations.
Worked Example: A Trend Across Predictor Groups
A hypothetical Poisson model gives each observation in three ordered predictor groups a fitted mean of 1, 2, and 3, respectively. The observed counts are \(0,0,1,1\) in group 1, \(1,1,2,2\) in group 2, and \(4,4,5,5\) in group 3. Calculate the average Pearson residual in each group and assess the pattern.
Method. Calculate each residual as \((y-\hat{\mu})/\sqrt{\hat{\mu}}\), then average within each group. Because the fitted mean is constant within each group, the calculation can also use the average observed count.
In group 1, the counts sum to \(0+0+1+1=2\), so their average is \(2/4=0.5\). The average Pearson residual is \((0.5-1)/\sqrt{1}=-0.500\).
In group 2, the counts sum to \(1+1+2+2=6\), so their average is \(6/4=1.5\). The average Pearson residual is \((1.5-2)/\sqrt{2}=-0.5/1.414=-0.354\), rounded to three decimals.
In group 3, the counts sum to \(4+4+5+5=18\), so their average is \(18/4=4.5\). The average Pearson residual is \((4.5-3)/\sqrt{3}=1.5/1.732=0.866\), rounded to three decimals.
The group averages rise from \(-0.500\) to \(-0.354\) to \(0.866\). The third group is systematically above its fitted mean, making the ordered pattern worth investigating as a possible mean-model problem. This is not a definitive test: the groups are small, and residuals can vary by chance. The relevant evidence is the change across predictor groups, not that each group contains repeated integer-count levels.
Check. The mean residual signs agree with the group count averages: the first two average counts are below their fitted means, and the third is above. A common mistake is to infer a pattern from the last group alone; the ordered comparison across all three groups gives the diagnostic context.
Zero Counts, Exposure, and a Common Trap
Zero observations are especially common when fitted means are small. For \(y=0\), the raw residual is \(-\hat{\mu}\), the Pearson residual is \(-\sqrt{\hat{\mu}}\), and the deviance residual is \(-\sqrt{2\hat{\mu}}\). As \(\hat{\mu}\) changes, these zero-count points trace different lower boundaries. A string of zero counts can therefore create a visible curved edge in a residual plot without, on its own, proving that the mean model is misspecified.
Exposure also affects the interpretation. In a Poisson model with a log link and exposure \(t_i\), an offset \(\log(t_i)\) allows the expected count to scale with exposure. Residuals should be interpreted relative to the fitted count mean for that observation, not relative to a rate treated as though it were a count. Comparing raw counts from very different exposure periods without accounting for exposure can create an apparent pattern that the model should instead address through its mean specification.
A frequent calculation error occurs in the deviance residual at \(y=0\). Substituting zero into \(y\log(y/\hat{\mu})\) appears to produce an undefined logarithm. The correct convention is the limit \(y\log(y/\hat{\mu})\to0\) as \(y\) decreases to zero, so the deviance residual is \(-\sqrt{2\hat{\mu}}\), not undefined.
Worked Example: A Zero Count With a Small Fitted Mean
A hypothetical policy-period has fitted Poisson mean \(\hat{\mu}=0.4\), after accounting for the policy's exposure. It experiences zero events. Calculate the raw, Pearson, and deviance residuals, then explain what the point can and cannot show.
Method. Use the fitted mean count \(0.4\) in all three formulas. For the deviance residual, apply the zero-count limit rather than evaluating a logarithm at zero.
The raw residual is \(0-0.4=-0.400\). The Pearson residual is \((0-0.4)/\sqrt{0.4}=-0.4/0.6325=-0.632\), rounded to three decimals.
For the deviance residual, the expression inside the square root is \(2\{0-(0-0.4)\}=2(0.4)=0.8\). The sign is negative because the observed count is below the fitted mean, so the residual is \(-\sqrt{0.8}=-0.894\), rounded to three decimals.
The three values are therefore \(-0.400\), \(-0.632\), and \(-0.894\). They are negative as required, and the deviance calculation is finite. This single zero is compatible with a small fitted mean and does not establish a poor mean model. Repeated patterns across a predictor or exposure range would require closer investigation.
Check. The fitted mean is positive and the observed count is below it, so all three residuals must be negative. The common trap is to report the deviance residual as undefined because of \(\log(0)\); the limiting convention gives the finite value shown.
Practical Interpretation
When reading a count-residual plot, first identify which features are forced by the response scale. Discrete levels, concentration at zero, and a moving lower boundary are expected possibilities. Then ask whether residuals show a persistent direction or shape across predictor values or fitted means. A visible band is a description of the data; a systematic change in residual behavior is a reason to question the mean relationship.
Avoid two opposite errors. The first is to label every non-smooth count plot as a failure because it does not resemble a continuous scatter. The second is to dismiss all structure as discreteness, even when residuals systematically change with a predictor. Neither visual appearance alone nor one unusual point establishes a conclusion. The goal is to recognize the response-driven pattern and distinguish it from organized departures that merit further diagnostic work.
Check Your Understanding
For each problem, distinguish the count scale's expected structure from evidence about the mean pattern.
- A Poisson observation has fitted mean \(0.25\) and observed count zero. Calculate its Pearson and deviance residuals to three decimals. (Answer: Pearson residual \(-0.500\); deviance residual \(-0.707\).)
- A Poisson observation has fitted mean \(4\) and observed count \(2\). Calculate its Pearson and signed deviance residuals to three decimals. (Answer: Pearson residual \(-1.000\); deviance residual \(-1.108\).)
- Two ordered predictor groups each contain three observations with fitted mean 2. Their counts are \(1,2,2\) in the first group and \(2,3,3\) in the second. Find the average Pearson residual in each group and state the direction of the pattern. (Answer: First group \(-0.236\); second group \(0.471\); the average residual increases across the groups.)
- A plot shows horizontal bands at small fitted means, with positive and negative residuals appearing across the predictor range and no persistent change in their signs. Is the banding alone evidence of a poor mean model? (Answer: No; discrete bands are expected for integer counts, and no systematic trend is described.)
- A zero count has fitted mean \(1.5\). A candidate writes its deviance residual as undefined because the formula contains \(\log(0)\). Give the corrected deviance residual to three decimals. (Answer: \(-\sqrt{3}=-1.732\).)