Skip to main content
ExamExplained
SA · General Mathematics
General Mathematics study scene
§-Syllabus dot point
SAGeneral MathematicsSyllabus dot point

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
  1. What this dot point is asking
  2. The least-squares line
  3. Prediction, interpolation and extrapolation
  4. Using residuals to assess fit
  5. What "least squares" actually minimises
  6. Choosing a non-linear model
  7. Linking back to correlation

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 y=a+bxy = a + bx, where bb is the slope and aa 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 aa and bb from a calculator, but you must interpret both:

  • The slope bb is the predicted change in yy for each one-unit increase in xx.
  • The intercept aa is the predicted value of yy when x=0x = 0.

Prediction, interpolation and extrapolation

Substituting an xx-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 xx.

  • 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 (xˉ,yˉ)(\bar{x}, \bar{y}), 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 r2r^2 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 r2r^2 is closer to 11. Citing both pieces of evidence - the residual pattern and the r2r^2 value - is what a full-mark justification requires; relying on r2r^2 alone is not enough, because a curved relationship can still produce a deceptively high r2r^2.

Linking back to correlation

The coefficient of determination r2r^2 from the correlation work tells you the proportion of variation in yy explained by the line. A high r2r^2 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 (SS million km squared) is recorded against the year of observation (DD) from 1980 to 2020. State the equation of the least-squares regression line using the context variables.
Show worked answer →

Enter the (D,S)(D, S) pairs into a calculator's linear regression. With DD explanatory and SS response, the calculator gives approximately slope 0.0872-0.0872 and intercept 178178.

So S=0.0872D+178S = -0.0872D + 178 (small rounding differences accepted). (1 mark for slope and intercept, 1 mark for using the context variables SS and DD rather than xx and yy.)

The negative slope reflects the steady decline in sea-ice area over time.

SACE 20232 marksCalculator-assumed. Using the least-squares line N=2.01t+79.5N = 2.01t + 79.5 for the number of potoroos NN after tt months, predict when the population reaches 300, and comment on the reliability.
Show worked answer →

Substitute N=300N = 300: 300=2.01t+79.5300 = 2.01t + 79.5, so 220.5=2.01t220.5 = 2.01t and t=220.52.01109.7t = \dfrac{220.5}{2.01} \approx 109.7 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 yy (thousands of dollars) on advertising spend xx (hundreds of dollars) gives y=5.2+1.8xy = 5.2 + 1.8x. At x=4x = 4 the actual sales were 13.5 (thousand dollars). Find the predicted value and the residual.
Show worked answer →

Predicted value: y=5.2+1.8(4)=12.4y = 5.2 + 1.8(4) = 12.4 (thousand dollars). [1 mark]

Residual =yactualypredicted=13.512.4=1.1= y_{\text{actual}} - y_{\text{predicted}} = 13.5 - 12.4 = 1.1 (thousand dollars), so the actual sales were 1100 dollars above the line. [1 mark]

A positive residual means the model underestimated this point.

ExamExplained