Why Compare Residual Structure?
Several curves can follow the overall direction of the same data while differing in how well they describe its shape. A curve may leave residuals that tend to be positive at low predictor values and negative in the middle, for example. That ordered pattern is evidence that the curve has not accounted for all of the response’s systematic variation across the predictor. Comparing predictor-specific residual plots helps reveal such differences.
The comparison is diagnostic, not a contest in which the winning plot proves a model true. Residuals depend on the fitted curve and the observations used to fit it. A plot with no obvious pattern means that this particular display did not reveal clear systematic structure; it does not establish that the candidate form is correct or that its assumptions all hold.
The Model and What a Residual Plot Can Check
For a single predictor, represent a candidate regression form as \(Y_i=m(x_i;\theta)+\varepsilon_i\). Here \(m(x_i;\theta)\) is the candidate mean response at predictor value \(x_i\), determined by parameters \(\theta\), and \(\varepsilon_i\) is the error. The usual regression assumptions include errors with mean zero at each predictor value, independent errors, and a common error variance. Normal errors are additionally used for some exact small-sample inference procedures; they are not required simply to read a residual plot.
A residual plot against \(x\) is especially useful for asking whether the fitted mean curve leaves an ordered pattern over the observed predictor range. A smooth run of positive residuals followed by negative ones, or a broad bend, suggests that the candidate curve may be missing structure. Residuals that fluctuate around zero without an evident ordered pattern offer less visual evidence of such a problem. This is a judgment about the display, not a formal proof of the assumptions above. Other assumptions, including independence and constant variance, also cannot be certified by a plot against \(x\) alone.
To compare forms fairly, fit them to the same response observations and plot residuals against the same predictor values. Keep the horizontal and vertical scales the same across candidate plots, and include a horizontal zero reference. Otherwise, a rescaled axis can make one pattern appear more or less prominent than another. Compare the order and shape of the residuals across \(x\), not just whether the residuals are positive or negative overall.
Why a Missing Pattern Is Not Proof
The residual identity explains the purpose and the limit of this diagnostic. Write the true conditional mean as \(m_{\text{true}}(x_i)\), and let the fitted curve at the observed predictor value be \(\hat{m}(x_i)\). Then
The first bracketed term is the discrepancy between the true mean and the fitted curve; the second is the error. If the fitted curve tracks the true mean reasonably well, the first term is small, and residuals mainly reflect errors. If the curve misses a broad feature in the mean, that discrepancy can show up as an ordered pattern in the residuals. But errors can obscure a real feature, and a finite set of observations can fail to show a pattern even when a model is imperfect.
There is another reason not to treat residuals as untouched observations: the same data were used to estimate the curve and calculate the residuals. Fitting constrains the residuals. For example, in a least-squares model with an intercept, the residuals sum to zero; in a least-squares straight-line model, they also have zero sample cross-product with the predictor. Those constraints do not mean that the residual plot is pattern-free. They do mean that the residuals are not independent checks of the curve, and a plot should be interpreted with that fitting process in mind.
Worked Example: A Straight Line Leaves a Broad Pattern
Suppose a hypothetical set of five observations has predictor values \(x=0,1,2,3,4\) and responses \(y=3,5,9,15,23\). Compare the least-squares straight-line fit with a quadratic fit.
For the straight line, \(\bar{x}=2\), \(\bar{y}=11\), and the least-squares slope is
The intercept is \(b_0=\bar{y}-b_1\bar{x}=11-5(2)=1\). Thus the fitted line is \(\hat{y}=1+5x\), with fitted values \(1,6,11,16,21\). Subtracting each fitted value from its observed response gives
In predictor order, the residuals are \(2,-1,-2,-1,2\): positive at both ends and negative through the middle. That broad pattern suggests the straight line has not captured the response’s curvature.
The quadratic \(y=3+x+x^2\) fits these five values exactly, so its five residuals are all zero. This deliberately clean example isolates the contrast between the candidate forms. In real data, exact zero residuals would be unusual; even here, the exact fit only describes these five observations. It does not prove that the quadratic is the correct relationship elsewhere or that the regression assumptions hold.
Compare the Patterns, Not Just the Residual Sizes
A useful comparison asks whether the pattern left by one candidate is reduced or changed under another. Look across the predictor range: Are there long runs on one side of zero? Does the residual sequence bend, or does it alternate without an evident broad trend? Does a noticeable feature persist under both forms? A pattern that remains under multiple plausible forms is a reason to investigate further; a feature removed by one form is evidence that the alternative may better account for that feature in these data.
Do not equate “smaller residuals” with “no systematic structure.” Residual size and residual order are different things: a modest but sustained run above zero can be more diagnostically informative than a few large residuals scattered across the range. Likewise, counting positive and negative residuals without considering their order discards the information that makes a predictor-specific plot useful.
Worked Example: A Quadratic Reduces the Broad Curvature
For a second hypothetical data set, let \(x=1,2,3,4,5\) and \(y=13.5,14,20.5,28,31.5\). Compare a least-squares straight line with the quadratic curve \(10+2x+0.5x^2\).
The response mean is \(\bar{y}=21.5\), and \(\bar{x}=3\). For the straight line, the numerator of the slope is
Therefore \(b_1=50/10=5\) and \(b_0=21.5-5(3)=6.5\). The fitted values are \(11.5,16.5,21.5,26.5,31.5\), so the residuals are
The quadratic gives fitted values \(12.5,16,20.5,26,32.5\), and hence residuals \(1,-2,0,2,-1\). Compared with the line’s broad positive-negative-positive sequence, the quadratic residuals do not show the same sustained bend. They still vary across the predictor range, however, and the sample has only five points. The comparison supports the limited conclusion that the quadratic removes the broad pattern seen under the line; it does not prove that the quadratic form is correct.
Worked Example: Read Residuals in Predictor Order
In another hypothetical analysis, two candidate forms are fitted to the same six observations. The responses are \(10,12,15,18,22,27\) at predictor values \(x=1,2,3,4,5,6\). The fitted values below are the reported outputs from the two candidate fits.
| \(x\) | Observed \(y\) | Fit A | Residual for A | Fit B | Residual for B |
|---|---|---|---|---|---|
| 1 | 10 | 10.5 | -0.5 | 9 | 1 |
| 2 | 12 | 11.5 | 0.5 | 13 | -1 |
| 3 | 15 | 15 | 0 | 17 | -2 |
| 4 | 18 | 18.5 | -0.5 | 19 | -1 |
| 5 | 22 | 21 | 1 | 21 | 1 |
| 6 | 27 | 27.5 | -0.5 | 25 | 2 |
For example, at \(x=3\), Fit A has residual \(15-15=0\), while Fit B has residual \(15-17=-2\). Reading each column in increasing \(x\) order, Fit A’s residuals switch signs without an obvious broad sequence. Fit B’s residuals are positive at the low end, negative through the middle, and positive at the high end. That ordered pattern is a diagnostic warning for Fit B, even though its residuals have both signs and sum to zero. Fit A shows less obvious structure in this display, but that observation alone does not establish that Fit A is correct.
A Practical Comparison
Confirm that each candidate fit uses the same response values and predictor values, so residuals have a comparable meaning and units.
For each observation, use \(e_i=y_i-\hat{y}_i\), and place that residual at its observed \(x_i\).
Keep the axes consistent across candidate plots and mark zero, so differences in apparent pattern are not artifacts of rescaling.
Report whether a broad ordered pattern is visible, reduced, or still present. Do not turn “no obvious pattern” into a claim that the model is proved correct.
Common Mistake
Also avoid comparing plots with different axis scales, or comparing residuals from different response scales as if their sizes were directly interchangeable. In this tutorial, the diagnostic comparison is about residual structure against the same predictor for candidate forms fitted to the same response observations.
Check Your Understanding
Answer each question using the definitions and comparison principles above.
- An observation has \(y_i=18\) and fitted response \(\hat{y}_i=20\). Calculate its residual and state what its sign means.
- Why should residual plots for candidate forms use the same horizontal and vertical scales?
- A candidate curve leaves a long run of positive residuals at low \(x\), then negative residuals at higher \(x\). What does that pattern suggest, and what does it not prove?
- Why does a residual plot without an obvious pattern not establish that the regression assumptions all hold?
- Two candidate fits have residuals with the same number of positive and negative values. Explain why that count alone is not enough to compare their residual structure.