Residual analysis in bivariate data (QCE General Mathematics Unit 3)
“Calculate residuals for a least-squares line, construct a residual plot, and use it to assess the appropriateness of fitting a linear model to the data”
A residual is actual minus predicted: positive above the line, negative below, and the residuals of a least-squares line sum to zero. A residual plot graphs residuals against the explanatory variable; random scatter means a linear model is appropriate, while a clear pattern such as a curve means it is not, even when is high. Residuals can also be used backwards (actual predicted residual) to recover a line or a missing value.
What this dot point is asking
Fitting a least-squares line is only half the job; the other half is checking whether a straight line was the right model. The QCAA General Mathematics 2025 syllabus (Topic 2, Bivariate data analysis 2) asks you to construct a residual plot and use it to assess the appropriateness of fitting a linear model to the data. That means calculating residuals (the vertical gaps between the data and the line), plotting them against the explanatory variable, and reading the pattern.
Residual questions appear in IA2, the problem-solving and modelling task and the external assessment. They range from one-mark calculations to multi-step problems like the six-mark question below, which is modelled on a QCAA item and works backwards from residuals to recover the line.
The answer
Residuals
For each data point, the least-squares line gives a predicted value. The residual is how far the actual value is from that prediction:
- A positive residual: the point is above the line (the model under-predicted).
- A negative residual: the point is below the line (the model over-predicted).
- A zero residual: the point is on the line.
For typing speed (words per minute) against hours of practice , the line is . A student who practised 3 hours has a predicted speed of ; if they actually type 41 words per minute, the residual is words per minute.
Rearrangements are common: actual predicted residual, and predicted actual residual.
Two properties of least-squares residuals:
- They always sum to zero (positive and negative residuals balance), so a residual plot always has points on both sides of zero.
- They are measured in the units of the response variable.
Constructing a residual plot
A residual plot is a scatterplot with:
- the explanatory variable () on the horizontal axis, and
- the residual for each point on the vertical axis,
with a horizontal reference line at residual (which represents the least-squares line).
To construct one: calculate the predicted value for each , subtract it from the actual , then plot each (x, residual) pair. A spreadsheet or calculator speeds this up, but in an examination you may be asked to calculate one or two residuals by hand and plot them.
Reading a residual plot
If the residuals are randomly scattered above and below zero with no pattern, a linear model is appropriate. If they show a clear pattern (especially a curve, such as positive, then negative, then positive), the association is non-linear and a linear model is not appropriate, however high is.
The reason is simple: if the true association is a curve, a straight line must cut across it, so it will be too high in some places and too low in others, and the residuals will run in blocks of the same sign. Random errors, on the other hand, jump above and below the line unpredictably.
In the stopping-distance data the residuals are , , , , , , , (to one decimal place): positive at both ends and negative in the middle. The line has , yet it is the wrong shape. It even predicts a negative stopping distance ( m) at a speed of 0, which is impossible.
Compare the typing data (hours 1 to 8; speeds 32, 35, 41, 42, 47, 49, 55, 56). The residuals are , , , , , , and : they jump above and below zero with no pattern, so the linear model is appropriate.
Other features of a residual plot
- An isolated large residual suggests a possible outlier; check the data point and comment on it.
- A fan shape (residuals getting larger as increases) means predictions are less reliable at large , even if the pattern is otherwise linear.
Residuals and
The coefficient of determination tells you the proportion of the variation in explained by the linear model; the residual plot tells you whether the linear model has the right shape. Report both: ", so of the variation in typing speed is explained by practice time, and the residual plot shows random scatter, so the linear model is appropriate."
If a residual plot shows a curve, the syllabus conclusion is that a linear model is not appropriate. Straightening curved data with transformations is not part of the QCAA syllabus (see the data transformation page if you are curious), so in QCAA assessment the expected response is to recognise and explain the non-linearity, and to be cautious about predictions from the line.
Working backwards from residuals
Because residual actual predicted, a residual lets you recover the line or a missing value. Combined with and the fact that the line passes through (so ), this allows multi-step questions like the blood pressure problem below: find a predicted value from one residual, use it with the slope to find , then use another residual to find an actual value.
Calculating residuals
The line models typing speed against practice hours. Find the residuals for the students with () and ().
. Predicted ; residual .
. Predicted ; residual .
Marker's note: show the predicted value on its own line before subtracting.
Judging a residual plot
Stopping-distance residuals (in order of speed): , , , , , , , . Is a linear model appropriate?
Pattern. Two positive, four negative, two positive: a U-shape.
Conclusion. The association between speed and stopping distance is non-linear, so a linear model is not appropriate, despite .
Marker's note: describe the pattern in words ("positive, then negative, then positive"), then state the conclusion.
Finding the line from summary statistics and residuals
, , , , . Find the line, the residual for , and the -value of the point with and residual .
- Line
- ; ; .
- Residual
- Predicted at 24 is 77.68; residual .
- Missing
- Predicted at 15 is 60.4; actual .
Marker's note: the formula and are in the QCAA syllabus and are worth memorising.
The problem in brief
A 31-year-old with blood pressure 119 has residual ; , , . The 40-year-old has residual 1.4.
Chain. Predicted at 31 ; ; ; predicted at 40 ; actual .
Marker's note: every link in the chain earns a mark, so write each one.
- Predicted minus actual
- A residual is actual minus predicted; reversing it flips every sign.
- Plotting residuals against
- The horizontal axis of a residual plot is the explanatory variable .
- Trusting a high
- A curved association can have above 0.95; only the residual plot tests linearity.
- Seeing a pattern that is not there
- A few residuals of the same sign in a row can happen by chance; look for a clear, systematic shape across the whole plot.
- Rounding too early in chained problems
- Keep full precision until the final answer.
- Predicting outside the data with a poorly fitting line
- Extrapolation from a line that is the wrong shape can give impossible answers.
For any residual calculation, write "predicted " then "residual ". For "Is a linear model appropriate? Justify" questions, use: "The residual plot shows [random scatter / a clear curved pattern], so a linear model [is / is not] appropriate." In a reverse problem, write the formula residual actual predicted and rearrange it in words before substituting.
A line of best fit makes a guess for every point, and the residual is how far off the guess was: the real value minus the guess. If you plot all those misses and they bounce up and down randomly, the line is doing a fair job. If they make a smile or frown shape, the line is guessing too low at the ends and too high in the middle, which means the data really follows a curve and a straight line is the wrong tool.
Exam-style questions
Questions in the style of QCAA 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.
Practice6 marksResearchers gathered data to determine if a model could reliably predict systolic blood pressure given a person's age. One candidate was 31 years old with a systolic blood pressure of 119. For this data the correlation coefficient r is 0.875, the standard deviation for age is 4 and for systolic blood pressure is 6. A residual plot was produced for the model (the residual for the 31-year-old reads -0.75, and the residual for the oldest person, aged 40, reads 1.4). Determine the actual systolic blood pressure, to the nearest whole number, for the oldest person in the sample (40 years old).Show worked answer →
The key relationship is residual actual predicted, so predicted actual residual and actual predicted residual.
Step 1: a predicted value from a residual (1 mark). For the 31-year-old: , so the predicted value at age 31 is .
Step 2: slope (1 mark). .
Step 3: -intercept (1 mark). The point lies on the line : , so . The model is .
Step 4: predicted value at age 40 (1 mark). .
Step 5: add the residual (1 mark). Actual .
Step 6: round and state (1 mark). The oldest person's systolic blood pressure is about 133.
A positive residual means the actual value is above the line. Keep full precision until the final rounding.
Modelled on the QCAA 2021 General Mathematics external assessment (not checked word for word against the paper) (question summarised; the residual plot is described in words).
Practice questions
Original practice questions graded from foundation to exam level, each with a full worked solution. Try them before revealing the solution.
foundation2 marksA least-squares line is , where is hours of practice and is typing speed (words per minute). A student who practised for 3 hours types at 41 words per minute. (a) Find the predicted typing speed. (b) Find the residual and say whether the point lies above or below the line.
Show worked solution →
(a) words per minute. (1 mark)
(b) Residual . It is positive, so the point lies above the line: the student types 1.67 words per minute faster than predicted. (1 mark)
foundation1 markA data point has a predicted value of 72.4 and a residual of . Find the actual value.
Show worked solution →
Actual predicted residual . (1 mark)
foundation2 marksWhat goes on each axis of a residual plot, and what does the horizontal line through zero represent?
Show worked solution →
The explanatory variable goes on the horizontal axis and the residuals on the vertical axis. (1 mark)
The line residual represents the least-squares line itself: points above it were under-predicted, points below it over-predicted. (1 mark)
core3 marksStopping distances ( m) of a car at speeds ( km/h) are: (20, 6), (30, 11), (40, 18), (50, 25), (60, 34), (70, 43), (80, 54), (90, 67). The least-squares line is with . (a) Find the residuals at 20 km/h and 50 km/h. (b) The residuals, in order of speed, are positive, positive, negative, negative, negative, negative, positive, positive. Is a linear model appropriate? Explain.
Show worked solution →
(a) At 20: predicted ; residual . At 50: predicted ; residual . (2 marks)
(b) No. The residuals form a clear curved (U-shaped) pattern, so the association is non-linear: the line over-predicts at middle speeds and under-predicts at low and high speeds. This is true even though is very high. (1 mark)
core2 marksFor the typing data (hours : 1 to 8; speeds 32, 35, 41, 42, 47, 49, 55, 56) and the line , the residuals are , , 1.68, , 0.61, , 1.54 and . (a) Check that they add to about zero. (b) What does the residual plot show?
Show worked solution →
(a) . (1 mark) The residuals of a least-squares line always sum to zero (here allowing for rounding).
(b) The residuals switch between positive and negative with no pattern: random scatter. The linear model is appropriate. (1 mark)
core2 marksExplain why a very high coefficient of determination does not by itself show that a linear model is appropriate.
Show worked solution →
measures how much of the variation in the response variable is explained by the linear model; curved data can still lie close to a straight line over a limited range, giving a high (the stopping-distance data has ). (1 mark)
Only the residual plot shows whether the errors are random (linear model appropriate) or follow a pattern (model systematically wrong). (1 mark)
exam4 marksFor a data set, , , , and . (a) Find the equation of the least-squares line in the form . (b) A data point is in the data set. Find its residual. (c) Another data point has and residual . Find its -value.
Show worked solution →
(a) ; . So . (2 marks)
(b) Predicted at 24: . Residual . (1 mark)
(c) Predicted at 15: . Actual . (1 mark)
exam3 marksUsing the stopping-distance model , a student predicts the stopping distance at 10 km/h. (a) Find the prediction. (b) Evaluate the reasonableness of this prediction, referring to the residual plot and to extrapolation.
Show worked solution →
(a) m. (1 mark)
(b) The prediction is not reasonable: a stopping distance cannot be negative. (1 mark) It is an extrapolation (10 km/h is below the smallest speed in the data, 20 km/h), and the curved residual plot already showed that the linear model does not fit the shape of the data, so extending it beyond the data is especially unreliable. (1 mark)