Skip to main content

Residuals and residual plots in WACE Mathematics Applications Unit 3

Syllabus dot point

“Calculate residuals, construct and interpret a residual plot, and use it to judge whether a linear model is appropriate.”

WACEMathematics ApplicationsUnit 37 min read

Quick answer

A residual is the vertical gap between an observed point and the least-squares line: residual == observed −- predicted. A residual plot graphs these residuals against the explanatory variable. If the residuals scatter randomly about zero with no pattern, a straight line is a good model; if they show a curve or other pattern, the linear model is wrong and the data should be transformed.

Jump to a section
  1. What this dot point is asking
  2. What a residual is
  3. The residual plot
  4. Using the residual plot in the investigation
  5. Properties of residuals
  6. A worked residual-plot reading
  7. Exam-style questions

What this dot point is asking

You must calculate residuals, construct and read a residual plot, and use it to judge whether a linear model fits.

What a residual is

After fitting the least-squares line, each data point has a predicted value from the line and an observed (actual) value. The difference is the residual.

Residual

Residual == observed value −- predicted value =y−y^= y - \hat{y}, where y^\hat{y} is the value the line predicts at that xx.

A positive residual means the point lies above the line (the model underpredicted); a negative residual means it lies below (the model overpredicted). The least-squares line is built so the residuals sum to zero.

The residual plot

A residual plot graphs the residual on the vertical axis against the explanatory variable on the horizontal axis, with a reference line at zero. It magnifies any pattern the line failed to capture.

Random scatter means a good linear fit

If a straight line is the right model, the residual plot shows points scattered randomly above and below zero with no shape. Any clear pattern (a curve, a fan, or systematic runs) means the linear model is not appropriate, even if the correlation coefficient looked high.

What the shapes mean:

  • No pattern (random scatter): linear model is appropriate.
  • Curved pattern (U or arch): the true relationship is non-linear; transform the data.
  • Fan shape (spread grows or shrinks): the scatter is not constant; the linear model may be unreliable for predictions.
Worked example

Calculating residuals and judging the fit

A least-squares line y=5+3xy = 5 + 3x is fitted to five points. Three of them are (2,12)(2, 12), (4,16)(4, 16) and (6,23)(6, 23).

Step 1: Predict the value at each x using the fitted line

Substituting each xx into the equation gives the value the line predicts at that point.

At x=2x = 2: y^=5+3(2)=11\hat{y} = 5 + 3(2) = 11. At x=4x = 4: y^=5+3(4)=17\hat{y} = 5 + 3(4) = 17. At x=6x = 6: y^=5+3(6)=23\hat{y} = 5 + 3(6) = 23.

Step 2: Calculate each residual as observed minus predicted

A residual measures how far the actual point sits above or below the line; its sign shows the direction of the gap.

At (2,12)(2, 12): residual =12−11=1= 12 - 11 = 1 (above the line).

At (4,16)(4, 16): residual =16−17=−1= 16 - 17 = -1 (below the line).

At (6,23)(6, 23): residual =23−23=0= 23 - 23 = 0 (on the line).

Step 3: Read the residual plot to judge the fit

These residuals (+1+1, −1-1, 00) sit close to zero with no obvious pattern, which supports a linear model. If all five residuals scatter randomly about zero, the straight line is a reasonable model. If instead they were, say, all positive at the ends and negative in the middle, that arch shape would signal a curved relationship needing a transformation.

Using the residual plot in the investigation

The residual plot is the diagnostic step after fitting a line. A high correlation coefficient rr is not enough on its own: a curved data set can still give a large rr. The residual plot is the more reliable check, because a curve hidden in a high-rr scatterplot shows up clearly as a pattern in the residuals. When you see a pattern, return to the transformation step and straighten the data before re-fitting.

Properties of residuals

Two facts about least-squares residuals are worth knowing. First, the residuals always sum to zero, because the line is positioned so the positive and negative gaps balance; this is a quick check on a completed residual table. Second, the least-squares line passes through the mean point (xˉ,yˉ)(\bar{x}, \bar{y}), so the residual at the mean is zero. These properties follow from how the line is fitted to minimise the sum of squared residuals.

A worked residual-plot reading

Suppose a line is fitted to data and the residuals, read left to right across the explanatory variable, run −3,−1,+2,+3,+2,−1,−4-3, -1, +2, +3, +2, -1, -4. Plotted against xx, these rise from negative to positive and back to negative, an arch (curved) pattern rather than random scatter. That arch is the signal that the true relationship curves and the straight line systematically under- then over-predicts, so a transformation (such as squaring or a logarithm) is needed before a line is appropriate. A genuinely random set of residuals would show no such run of signs.

Common errors
Reversing the residual
It is observed minus predicted, not predicted minus observed; the sign matters for whether the point is above or below the line.
Trusting a high rr over the residual plot
A large rr can hide curvature; the residual plot is the better test of linearity.
Calling a random scatter a "bad fit"
Random scatter about zero is exactly what a good linear model produces.
Plotting residuals against the predicted instead of the explanatory variable
In this course the residual plot uses the explanatory variable on the horizontal axis.

Exam-style questions

Questions in the style of SCSA exam questions on this dot point, each with a worked answer. They are written by ExamExplained unless tagged "Past paper"; the year shows the paper a question is modelled on.

WACE 2022-style5 marks
A least-squares line y=12+2.5xy = 12 + 2.5x is fitted to data. At x=6x = 6 the observed value is y=30y = 30. (a) Calculate the predicted value and the residual. (b) State what the sign of the residual tells you. (c) Explain what a clear curved pattern in the residual plot would indicate.
Show worked answer →

A residual is the observed value minus the predicted value.

(a) Predicted y=12+2.5(6)=12+15=27y = 12 + 2.5(6) = 12 + 15 = 27. Residual =30−27=3= 30 - 27 = 3. (3 marks)

(b) The positive residual means the observed point lies above the line, so the model underpredicted at x=6x = 6. (1 mark)

(c) A clear curved pattern in the residual plot indicates the linear model is not appropriate; the relationship is non-linear and the data should be transformed before fitting a line. (1 mark)

Markers reward observed-minus-predicted, the above-the-line meaning of a positive residual, and reading a curved residual plot as non-linearity.

WACE 2024-style4 marks
Explain what a residual plot is and describe what its appearance should look like if a straight line is an appropriate model for the data.
Show worked answer →

A residual plot graphs the residuals against the explanatory variable.

A residual plot has the explanatory variable on the horizontal axis and the residual (observed minus predicted) on the vertical axis, with a horizontal line at zero. (2 marks)

If the linear model is appropriate, the residuals are scattered randomly above and below zero with no pattern, roughly evenly spread. A pattern such as a curve or a fan shape signals that a straight line is not appropriate. (2 marks)

Markers reward the axes of the plot and "random scatter about zero" as the signal of a good linear fit.

Practise this

Sources & how we know this

ExamExplained