How do we fit the best straight line to data and use it to predict?
Determine and interpret the least-squares regression line, use it to make predictions, and assess fit using residuals.
How to find and interpret the least-squares line y = a + bx, use it for prediction, distinguish interpolation from extrapolation, and read residuals to judge the fit.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
You must find the regression line (usually with a calculator), interpret its slope and intercept, use it to predict, and judge its fit using residuals.
The least-squares line
The least-squares line is written , where is the slope and is the vertical intercept. It is the unique line that makes the total of the squared vertical distances from the points to the line as small as possible.
In practice you read and from a calculator, but you must interpret both:
- The slope is the predicted change in for each one-unit increase in .
- The intercept is the predicted value of when .
Prediction, interpolation and extrapolation
Substituting an -value inside the range of the data is interpolation, which is usually reliable. Substituting beyond the data range is extrapolation, which is risky because the linear pattern may not continue.
Using residuals to assess fit
After fitting the line, residuals tell you how good the fit is. A residual plot graphs each residual against .
- If the residuals are scattered randomly above and below zero with no pattern, a linear model is appropriate.
- If the residual plot shows a clear curve or pattern, the relationship is not really linear and a straight line is the wrong model.
What "least squares" actually minimises
The line is called "least squares" because, among all possible straight lines, it makes the sum of the squared residuals as small as possible. Squaring the residuals serves two purposes: it stops positive and negative gaps from cancelling, and it penalises large misses more heavily than small ones, so the line is pulled toward the bulk of the data. The line always passes through the mean point , which is a useful checkpoint and explains why a single far-off outlier can swing the line noticeably - it drags the squared-distance total up until the line tilts toward it.
Choosing a non-linear model
When a residual plot shows a clear curved pattern, the straight-line model is wrong even if its looks high. SACE often compares a linear fit with an exponential one for growth data such as subscriber numbers or populations. The better model is the one whose residual plot is patternless and whose is closer to . Citing both pieces of evidence - the residual pattern and the value - is what a full-mark justification requires; relying on alone is not enough, because a curved relationship can still produce a deceptively high .
Linking back to correlation
The coefficient of determination from the correlation work tells you the proportion of variation in explained by the line. A high together with a patternless residual plot means the linear model is a strong fit.
Exam-style practice questions
Practice questions written in the style of SACE Board exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
SACE 20222 marksCalculator-assumed. The area of Arctic sea ice ( million km squared) is recorded against the year of observation () from 1980 to 2020. State the equation of the least-squares regression line using the context variables.Show worked answer →
Enter the pairs into a calculator's linear regression. With explanatory and response, the calculator gives approximately slope and intercept .
So (small rounding differences accepted). (1 mark for slope and intercept, 1 mark for using the context variables and rather than and .)
The negative slope reflects the steady decline in sea-ice area over time.
SACE 20232 marksCalculator-assumed. Using the least-squares line for the number of potoroos after months, predict when the population reaches 300, and comment on the reliability.Show worked answer →
Substitute : , so and months. (1 mark)
So about 110 months. This is an extrapolation well beyond the 60-month data range, so it should be treated with caution. (1 mark)
SACE 20212 marksCalculator-assumed. A regression of weekly sales (thousands of dollars) on advertising spend (hundreds of dollars) gives . At the actual sales were 13.5 (thousand dollars). Find the predicted value and the residual.Show worked answer →
Predicted value: (thousand dollars). [1 mark]
Residual (thousand dollars), so the actual sales were 1100 dollars above the line. [1 mark]
A positive residual means the model underestimated this point.
