Why Compare Residual Spread?
A residual plot can show more than whether the points are centered around zero. The vertical spread of the residuals may also change across the horizontal axis. For example, residuals may be tightly grouped at lower fitted values and much more dispersed at higher fitted values. That pattern is a reason to investigate whether the variability around the fitted mean is stable; it is not, by itself, proof about the unobserved errors.
This tutorial uses a simulated regression to work through that diagnosis. The key comparisons are a plot of residuals against fitted values and a plot of residuals against a predictor. Both can be informative, but their patterns need to be read in context. In particular, two plots are not necessarily independent pieces of evidence.
Model and Plot Definitions
For a simple linear regression, write the working model as \(Y_i=\beta_0+\beta_1x_i+\epsilon_i\). Here \(Y_i\) is the response for observation \(i\), \(x_i\) is its predictor value, and \(\epsilon_i\) is the unobserved error. The fitted value is \(\hat{y}_i=b_0+b_1x_i\), and the residual is \(e_i=y_i-\hat{y}_i\). A residual is therefore the observed response minus its fitted value; it is not the unobserved error itself.
The usual diagnostic setup presumes that the mean response is described adequately by the fitted linear mean and that observations are independent. A plot of residual spread is used to assess whether the variability around that mean appears reasonably stable. Stable variability is the condition being checked, not something to assume in order to declare a plot satisfactory. Normality is a separate question and is not required just to compare vertical spread visually.
A widening or narrowing cloud is more relevant to unequal spread than a single unusually large residual. A shift in the residual center can instead suggest that the fitted mean is missing a pattern. Both features can occur together, so inspect the center and the spread separately. A plot is visual evidence, not a formal test and not a direct view of the errors.
Worked Diagnosis With a Clear Change in Spread
The data below are hypothetical and simulated. They were constructed from a straight-line fitted mean with modest residuals at lower predictor values and larger residuals at higher values.
Worked Example: A Clear Widening in the Residual Plot
Suppose eight observations have predictor \(x\), response \(y\), fitted value \(\hat{y}\), and residual \(e=y-\hat{y}\) as shown. The candidate fitted line is \(\hat{y}=10+2x\).
| \(x\) | \(y\) | \(\hat{y}=10+2x\) | \(e=y-\hat{y}\) |
|---|---|---|---|
| 1 | 13 | 12 | 1 |
| 2 | 13 | 14 | -1 |
| 3 | 15 | 16 | -1 |
| 4 | 19 | 18 | 1 |
| 5 | 16 | 20 | -4 |
| 6 | 26 | 22 | 4 |
| 7 | 28 | 24 | 4 |
| 8 | 22 | 26 | -4 |
Check the fit. The residuals sum to zero: \(1-1-1+1-4+4+4-4=0\). They are also orthogonal to the centered predictor:
Here \(\bar{x}=4.5\). These checks matter: with an intercept, least-squares residuals sum to zero, and in simple regression their product sum with the centered predictor is also zero. Thus the listed residuals are consistent with the claimed least-squares line, rather than merely resembling residuals in a sketch.
Compare the spread. For fitted values 12, 14, 16, and 18, the residual magnitudes are all 1. For fitted values 20, 22, 24, and 26, they are all 4. The mean absolute residual is therefore 1 in the lower fitted-value group and 4 in the higher group. Both groups have residual mean zero, so this example shows a widening in spread without a shift in the group centers.
In a residual-versus-fitted plot, the points form a narrow band at the lower fitted values and a visibly wider band at the higher fitted values. Since the fitted values increase with \(x\), the residual-versus-\(x\) plot shows that same progression here. The appropriate conclusion is that this simulated fit displays clear visual evidence of larger residual spread at higher fitted values and predictor values. It does not establish the true variability of unobserved errors in a real data set.
Why the Least-Squares Checks Work
The checks above follow directly from how least squares chooses its coefficients. For an intercept-containing simple regression, least squares minimizes the sum of squared residuals over the choices of \(b_0\) and \(b_1\). At the minimizing values, the derivatives with respect to both coefficients are zero:
Consequently, \(\sum_i e_i=0\) and \(\sum_i x_i e_i=0\). Since \(\sum_i e_i=0\), subtracting \(\bar{x}\sum_i e_i\) from the second equality gives \(\sum_i(x_i-\bar{x})e_i=0\). These are algebraic properties of the fitted residuals, not evidence that the unobserved errors have any particular spread.
Read Predictor-Specific Plots With Care
A predictor-specific plot can help show where in the predictor range residuals are more dispersed. Its relationship to the fitted-value plot depends on the regression. In a simple regression with a positive slope, fitted values increase with the predictor, so the horizontal ordering is the same. With a negative slope, fitted values decrease as the predictor increases, so the ordering is reversed. In either case, the two plots show corresponding residuals under a linear change of horizontal scale; they are not independent confirmation of the same pattern.
With several predictors, a plot against one predictor may look different from the fitted-value plot because fitted values depend on all predictors. The predictor-specific view can still be useful, but it is a marginal display: observations can differ in other predictors as that predictor changes. Do not treat a pattern in one such plot as proof that variability changes solely with that predictor.
Worked Example: A Negative Slope Reverses the Horizontal Order
Consider a hypothetical simple regression with \(x=1,2,3,4,5,6\), fitted values from \(\hat{y}=20-2x\), and residuals \(1,-1,0,0,-1,1\), respectively. The responses are obtained by adding each residual to its fitted value.
The fitted values are \(18,16,14,12,10,8\), and the responses are \(19,15,14,12,9,9\). The residuals sum to \(1-1+0+0-1+1=0\). Their centered-predictor product sum is also zero:
These checks support the stated least-squares line. Against \(x\), the residual sequence is \(1,-1,0,0,-1,1\). Against fitted value, the horizontal order runs from \(18\) down to \(8\) as \(x\) increases, so the same points appear in reverse horizontal order. The first three and last three residuals have the same absolute values, respectively \(\{1,1,0\}\) and \(\{0,1,1\}\). There is no widening from one end to the other in this small example. The reversal is a plotting consequence of the negative slope, not a change in the residuals.
Clear Pattern, Uncertain Meaning
The first example was deliberately constructed to have a strong contrast in residual magnitudes. Real samples are less controlled: each residual is only one observed deviation, and a small number of points can make an apparent funnel unstable. It is useful to describe what the plot shows before interpreting why it might have occurred.
Worked Example: When the Visual Evidence Is Limited
Suppose a hypothetical intercept-containing regression has six predictor values \(x=1,2,3,4,5,6\), fitted values \(18,16,14,12,10,8\), and residuals \(1,-1,0,0,-1,1\). These are the values checked in the preceding example. Compare the first three and last three observations as a simple descriptive summary.
For the first three residuals, the absolute values are \(1,1,0\), with mean \((1+1+0)/3=0.667\). For the last three, they are \(0,1,1\), with mean \((0+1+1)/3=0.667\). The two groups have the same mean absolute residual, and each group's signed residuals sum to zero. This summary gives no indication of an increasing spread across the predictor range.
The plot still contains only six observations, so it cannot establish that the underlying variability is constant. A different sample could show a less balanced pattern simply by chance. The careful conclusion is limited: these residuals do not show a clear widening, and the small sample provides only limited visual information about spread.
Common Mistakes and a Practical Reading Sequence
A diagnosis should keep the display, the interpretation, and its limitations distinct. Use a repeatable sequence rather than naming a model problem from a single point.
Look for residuals centered roughly around zero across the horizontal range. A systematic shift in center is not the same feature as a change in spread.
Ask whether the typical distance from zero or the overall vertical band appears to grow or shrink across fitted values or predictor values. Do not let one isolated residual decide the diagnosis.
In simple regression, fitted values are an affine function of the predictor; a negative slope reverses the horizontal order. In multiple regression, fitted values also reflect the other predictors.
Describe a pattern as clear, weak, or not apparent in the plotted residuals. Do not claim that a visual pattern proves a feature of the unobserved errors.
A common mistake is to say, “The points spread out at higher fitted values, so the errors definitely have higher variance there.” The plot displays fitted residuals, not the unobserved errors, and residuals are affected by fitting the model. Correctly, the widening is visual evidence consistent with changing residual spread and a reason for further assessment, not certainty about the error distribution. Another mistake is to count a fitted-value plot and a predictor plot from simple regression as two independent confirmations. Their horizontal order is the same for a positive slope and reversed for a negative slope, so they display the same residual pattern on related axes.
Check Your Understanding
Try these questions using the definitions and examples above.
- In the first worked example, what are the mean absolute residuals for the lower and higher fitted-value groups, and what do they suggest?
- Why does an intercept-containing least-squares regression have residuals that sum to zero?
- In a simple regression with a negative slope, how does the horizontal ordering in a residual-versus-fitted plot relate to the ordering in a residual-versus-predictor plot?
- Why should a widening residual plot be described as visual evidence rather than proof about the unobserved errors?
- What is one reason a residual-versus-predictor plot in a multiple regression might show a different pattern from the residual-versus-fitted plot?