Tutorials › Exam SRM - Statistics for Risk Modeling › Reading Residual Plots in a Model-Selection Case

Exam SRM · Regression and Selection Cases · Tutorial 842 of 926

Reading Residual Plots in a Model-Selection Case

Use regression residual plots to identify assumption concerns and decide which conclusions or candidate-model comparisons need caution.

Advanced 11 min read

What You'll Learn

  • Identify the regression assumptions assessed by common residual plots.
  • Read curvature in residuals versus fitted values as evidence about the mean form.
  • Compare residual spread across fitted-value groups to diagnose changing variance.
  • Use a normal Q–Q plot to assess tail departures without treating it as a proof.
  • Detect possible residual dependence from observations in their natural order.
  • Explain how diagnostic concerns affect inference and candidate-model comparisons.

Why Read Residual Plots?

A regression model can produce a useful fitted relationship while still failing to describe some important feature of the data. A candidate may rank well by a selection criterion or validation score, yet its residuals may show curvature, changing spread, unusually heavy tails, or dependence. These patterns matter because different departures affect different conclusions: a misspecified mean can distort fitted effects, while nonconstant variance or dependence can make conventional standard errors unreliable.

Residual plots are diagnostic evidence, not automatic verdicts. A pattern can arise by chance, especially in a small sample, and a plot without an obvious pattern does not prove every assumption. The purpose is to ask which assumptions look questionable and whether the intended interpretation or comparison depends on them.

Model and Residual Definitions

For observations \(i=1,\ldots,n\), consider the multiple linear regression model

$$ Y_i=\beta_0+\beta_1x_{i1}+\cdots+\beta_px_{ip}+\varepsilon_i. $$

Here \(Y_i\) is the response, \(x_{ij}\) are observed predictors, and \(\varepsilon_i\) is the unobserved error. The usual conditions relevant to these diagnostics are that the conditional mean has the stated linear form, errors have mean zero conditional on the predictors, their variance is constant, and errors from different observations are independent. Normal errors are an additional assumption used for exact small-sample t and F inference; they are not required for the least-squares coefficient estimates to be calculated.

Definition: The fitted value for observation \(i\) is \(\hat{Y}_i\), and its ordinary residual is \(e_i=Y_i-\hat{Y}_i\). A residual is an observed estimate of an error, not the unobserved error itself. Residual plots display these estimates against fitted values, predictors, observation order, or theoretical normal quantiles.

The distinction between a true mean and a fitted estimate is important. Write \(m(x)=E(Y\mid X=x)\) for the true conditional mean and \(\hat{m}(x)\) for a fitted estimate. If the fit was obtained from independent training data, then, conditional on that fit, \(E(Y-\hat{m}(x)\mid X=x,\text{fit})=m(x)-\hat{m}(x)\). In contrast, for an in-sample observation the fitted value depends on the observed responses. It cannot generally be treated as fixed when taking a conditional expectation that does not condition on the fit.

For example, conditional on the full design matrix in a correctly specified ordinary least-squares model, the vector of residuals is \((I-H)\boldsymbol{\varepsilon}\), where \(H\) is the projection matrix onto the fitted regression space. Since \(E(\boldsymbol{\varepsilon}\mid X)=0\), it follows that \(E(\mathbf e\mid X)=(I-H)E(\boldsymbol{\varepsilon}\mid X)=0\). This statement is about an expectation over possible errors, not a claim that the realized residual at each fitted value must be zero or that an observed pattern is impossible.

Residuals Versus Fitted Values and Predictors

Plot \(e_i\) vertically against \(\hat{Y}_i\). If the conditional mean is adequately represented and the variance is roughly constant, residuals should fluctuate around zero without a systematic shape, and their vertical spread should be broadly similar across the fitted range. Plotting residuals against individual predictors can also reveal patterns tied to a predictor. In a multiple regression, however, a simple residual-versus-predictor plot does not by itself isolate that predictor’s adjusted effect.

A smooth U-shape or arch suggests that the mean relationship may not be adequately represented by the candidate model. A fan or funnel, with residual spread increasing or decreasing across fitted values, suggests nonconstant variance. These clues concern different features: curvature points toward a possible mean-form problem, while a fan points toward a variance problem. A fan does not, on its own, prove that the fitted conditional mean is wrong.

Worked Example: A Curved Pattern in a Candidate Model

A hypothetical analyst fits a simple linear regression to eight observations. The fitted values are 10, 20, 30, and 40, with two observations at each value. The residuals at those fitted values are, respectively, \((1,2)\), \((-1,-2)\), \((-2,-1)\), and \((2,1)\). Diagnose the pattern and assess what it means for interpreting the linear candidate.

Method. Group the residuals by fitted value, calculate each group’s mean, and check that the displayed residual pattern is consistent with the least-squares constraints.

At fitted value 10, the mean residual is \((1+2)/2=1.5\). At 20 it is \((-1-2)/2=-1.5\). At 30 it is \((-2-1)/2=-1.5\), and at 40 it is \((2+1)/2=1.5\). Thus the group means have the pattern \(1.5,-1.5,-1.5,1.5\): positive at both ends and negative in the middle.

The residual sum is \(3-3-3+3=0\). The fitted-value-weighted sum is \(10(3)+20(-3)+30(-3)+40(3)=30-60-90+120=0\), as required for residuals from a least-squares fit with an intercept and one predictor. The residual sum of squares is \(5+5+5+5=20\). With \(n=8\) and two fitted coefficients, the residual mean square is \(20/(8-2)=3.333\).

The systematic U-shaped group means are evidence that a straight-line conditional mean may be inadequate. The residual plot does not prove the true mean is curved, but it makes coefficient interpretations and predictions from this linear candidate questionable if the pattern is genuine. Common mistake avoided: do not treat the least-squares constraint that residuals sum to zero as evidence that residuals have no pattern; the grouped means here clearly do.

Checking Whether the Residual Spread Changes

A residual-versus-fitted plot is also useful for assessing constant variance. To make a rough numerical comparison, group residuals over portions of the fitted range and compare their squared magnitudes or their root-mean-square magnitudes. This is a descriptive check, not a formal test. Group sizes, leverage, and random variation can affect the display, so a numerical ratio should be read alongside the plot.

Worked Example: A Fan-Shaped Residual Spread

For a hypothetical regression with eight observations, four residuals at lower fitted values are \((-1,1,-1,1)\), and four at higher fitted values are \((-4,4,-4,4)\). The model has an intercept and one slope. Compare the residual spreads and state which conclusions are most exposed.

Method. Calculate the average squared residual within each group. The lower-fitted group has squared residuals \(1,1,1,1\), so its average square is \(4/4=1\), and its root-mean-square residual is \(\sqrt{1}=1\). The higher-fitted group has squared residuals \(16,16,16,16\), so its average square is \(64/4=16\), and its root-mean-square residual is \(\sqrt{16}=4\).

The high-to-low ratio of average squared residuals is \(16/1=16\); the ratio of root-mean-square residuals is \(4/1=4\). The residual sum of squares is \(4+64=68\). With eight observations and two fitted coefficients, the residual mean square is \(68/(8-2)=11.333\).

The much wider spread at higher fitted values is a strong descriptive warning about constant variance. Under a correctly specified conditional mean and zero-mean errors, ordinary least squares may still estimate the mean coefficients without bias, but conventional standard errors and tests that rely on constant variance may be unreliable. Common mistake avoided: a larger overall residual mean square does not describe the problem as clearly as comparing spread across the fitted range.

Normal Q–Q Plots and Residual Order

A normal Q–Q plot orders the residuals and compares them with quantiles from a normal distribution. If the error distribution is approximately normal, the plotted points should lie roughly along a straight reference line. Marked S-shaped departures or unusually distant endpoints can indicate skewness or tail behavior that is inconsistent with normal errors. The plot is a visual assessment; small samples provide limited information, and a few points need not establish a distributional failure.

Residuals plotted in observation order are useful when order has meaning, such as time, production sequence, or a sequence of repeated measurements. Runs, cycles, or long stretches on one side of zero can suggest dependence. If observations are dependent, standard errors and validation procedures that assume independent observations can be misleading. For data with a natural time order, that order must not be discarded simply because the regression was fit as a cross-sectional model.

Worked Example: Tail Departure in a Normal Q–Q Plot

A hypothetical intercept-only candidate is fit to eight responses. Its residuals, sorted from smallest to largest, are \((-6,-2,-1,0,0,1,2,6)\). Assess the tail evidence using the residual scale, and state what the plot can and cannot establish.

Method. For an intercept-only fit, the estimated mean is the sample mean. These residuals sum to zero, so they are centered as required. The sum of squared residuals is \(36+4+1+0+0+1+4+36=82\). There is one fitted coefficient, so the residual mean square is \(82/(8-1)=11.7143\), and the residual standard deviation estimate is \(\sqrt{11.7143}\approx3.4226\).

The two endpoints have absolute residuals \(6\), or \(6/3.4226\approx1.75\) residual standard deviations. The next pair has absolute residuals \(2\), or about \(0.58\) residual standard deviations; the next pair has absolute residuals \(1\), or about \(0.29\). On a normal Q–Q plot, the two extreme observations are therefore separated from most of the central observations. This makes the endpoints worth checking against the reference line for possible tail departures.

With only eight observations, this pattern is not proof that the errors are nonnormal. If normality is materially doubtful, exact small-sample t and F conclusions based on normal errors deserve caution; the plot alone does not determine whether a predictive model is useful. Common mistake avoided: a Q–Q plot assesses distributional shape, not whether the conditional mean is linear or whether the variance is constant.

Worked Example: Alternation in Observation Order

A hypothetical regression is fit to eight observations recorded sequentially. Its residuals in that order are \((2,-2,2,-2,2,-2,2,-2)\). Use a lag-one summary to assess the pattern and explain why the order matters.

Method. For these centered residuals, calculate the sum of adjacent products and divide by the sum of squared residuals as a descriptive lag-one correlation summary. The adjacent products are \(-4,-4,-4,-4,-4,-4,-4\), with sum \(-28\). The sum of squared residuals is \(8(2^2)=32\). Thus the summary is \(-28/32=-0.875\).

The large negative value reflects strong alternation: positive residuals are followed by negative ones, and vice versa. This is evidence to investigate dependence, not a formal significance test. If the observations represent time or another meaningful sequence, a model-selection comparison that assumes independent observations may not be trustworthy, and conventional regression standard errors may be invalid. Common mistake avoided: randomly reordering the observations before plotting would conceal this diagnostic pattern.

How Diagnostics Affect Model Conclusions

Residual diagnostics help identify which parts of a candidate model or its interpretation are fragile. The following distinctions are useful when comparing models or explaining results.

Observed residual patternMain concernConclusions to treat cautiously
Curvature against fitted values or a predictorThe conditional mean may not have the fitted formCoefficient interpretation, mean estimates, and predictions across the affected range
Fan-shaped or otherwise changing spreadConstant conditional variance may failConventional standard errors, tests, and intervals
Systematic Q–Q tail departureNormal-error approximation may be poorExact small-sample inference based on normal errors
Runs, cycles, or alternation in observation orderErrors may not be independentStandard errors and comparisons that assume independent observations

A residual pattern should not be used as a shortcut for declaring one candidate “best.” A validation score assesses predictive performance under its validation design; a residual plot assesses features of the fitted model and its errors. The two can give different warnings. For instance, a candidate may predict well on held-out observations drawn in the same way as the training data while still having nonconstant variance that undermines conventional inference. Conversely, an unusual residual plot in a small sample may not imply that another candidate will predict better.

When comparing candidates, check whether they use the same response scale and observations, whether the validation design respects any grouping or time order, and whether a diagnostic concern bears on the conclusion being made. Residual plots do not replace validation, and validation does not establish all regression assumptions. The appropriate conclusion is often qualified: identify the visible concern, state which assumption or claim it affects, and avoid stronger claims than the evidence supports.

Key takeaway: Read residual plots by matching each pattern to the assumption it challenges. Curvature raises a mean-form concern; changing spread raises a variance concern; Q–Q departures raise a normality concern; and order patterns raise a dependence concern. Use each as evidence for caution, not as a mechanical model-selection rule.

Check Your Understanding

For each problem, name the diagnostic evidence and identify the conclusion that deserves the most caution.

  1. A model’s residual means across four increasing fitted-value groups are \(2,1,-1,-2\), while the vertical spread looks similar in all groups. Which assumption is most in question? (Answer: The conditional mean form is most in question because the residual means show a systematic trend; the displayed information does not indicate changing variance.)
  2. Residuals in a lower fitted-value group are \((-2,2,-2,2)\), and in a higher group are \((-6,6,-6,6)\). What is the ratio of the groups’ average squared residuals? (Answer: \(36/4=9\) in the lower group and \(144/4=36\) in the higher group, so the ratio is \(36/9=4\).)
  3. A normal Q–Q plot is nearly straight in its center, but its two endpoints lie well beyond the reference line. Which model feature is being assessed, and what should not be concluded from this alone? (Answer: The normality of the error distribution is being assessed; the plot alone does not prove nonnormality or establish that the conditional mean is wrong.)
  4. Eight ordered residuals alternate between \(+1\) and \(-1\), starting with \(+1\). Using the adjacent-product-over-sum-of-squares summary, what is the value? (Answer: There are seven adjacent products of \(-1\), and the sum of squares is \(8\), so the summary is \(-7/8=-0.875\).)
  5. A candidate has a favorable validation score, but its residual plot shows a clear fan and its errors are used for conventional coefficient tests. Which result most directly needs caution, and why? (Answer: Conventional standard errors and tests need caution because the fan suggests nonconstant variance; a favorable validation score does not establish constant variance.)
Clinical Biostats