Skip to main content

Fitting and interpreting the least-squares line in WACE Mathematics Applications Unit 3

Syllabus dot point

“Fit a least-squares line using technology, interpret the slope and intercept in context, and predict while distinguishing interpolation from extrapolation.”

WACEMathematics ApplicationsUnit 38 min read

Quick answer

The least-squares line is the straight line that minimises the sum of the squared vertical distances from the points. Fit it with technology to get y=a+bxy = a + bx. The slope bb is the change in the response variable per one-unit increase in the explanatory variable; the intercept aa is the predicted response when x=0x = 0. Predict by substituting, and label the prediction interpolation (inside the data range, reliable) or extrapolation (outside it, risky).

Jump to a section
  1. What this dot point is asking
  2. What "least squares" means
  3. Interpreting slope and intercept
  4. Interpolation versus extrapolation
  5. Exam-style questions

What this dot point is asking

You must fit the line with technology, interpret the slope and intercept in context, predict, and distinguish interpolation from extrapolation.

What "least squares" means

For any straight line, each point has a vertical gap to the line called a residual. The least-squares line is the unique line that makes the sum of the squared residuals as small as possible, which is why it is the standard line of best fit.

The least-squares line

y=a+bxy = a + bx, where yy is the response variable and xx the explanatory variable. The slope is b=rsysxb = r\dfrac{s_y}{s_x} and the line passes through the mean point (xˉ,yˉ)(\bar{x}, \bar{y}). In practice you read aa and bb from the calculator's regression output.

Enter the paired data into the statistics menu, run the linear regression, and write the equation with the response variable on the left.

Interpreting slope and intercept

The whole point of fitting the line is to read meaning from aa and bb in the variables of the problem.

  • Slope bb: the predicted change in the response variable for each one-unit increase in the explanatory variable. Always state the direction (increase or decrease) and the units.
  • Intercept aa: the predicted response when the explanatory variable is zero. Sometimes this is meaningful, sometimes (for example "weight at age 00") it is not, and you should say so.
Interpret in real units, not symbols

A slope of 3.53.5 in "mark per hour studied" means each extra hour adds 3.53.5 percentage points to the predicted mark. Never leave the interpretation as "the slope is 3.53.5"; tie it to the variables and units of the question.

Worked example

Fitting and using a least-squares line

A cafe records the daily maximum temperature (xx, degrees Celsius) and the number of iced coffees sold (yy) over data from x=18x = 18 to x=35x = 35. Technology gives y=−30+6xy = -30 + 6x.

Interpret the slope

The slope 66 means each 11 degree rise in temperature is associated with 66 more iced coffees sold per day.

Interpret the intercept

The intercept −30-30 predicts sales at 00 degrees Celsius. This is meaningless here (you cannot sell a negative number, and 00 degrees is far below the data), so the intercept is not interpreted in context.

Predict at 28 degrees (interpolation)

x=28x = 28 lies inside the data range, so this is interpolation: y=−30+6(28)=−30+168=138y = -30 + 6(28) = -30 + 168 = 138 iced coffees.

Comment on a prediction at 45 degrees

x=45x = 45 is well outside the data range (1818 to 3535), so predicting there is extrapolation and unreliable; the linear pattern may break down at extreme heat.

Interpolation versus extrapolation

A prediction is only as trustworthy as the data behind it.

Interpolation and extrapolation

Interpolation predicts for an explanatory value inside the range of the data; it is generally reliable. Extrapolation predicts for a value outside the range; it is risky because the linear trend may not continue and there is no data to support it.

Always check whether the prediction value lies inside the minimum-to-maximum range of the explanatory variable before judging reliability. Markers expect this label on every prediction.

The reliability of an interpolated prediction also depends on r2r^2: a line explaining 85%85\% of the variation gives tighter predictions than one explaining 40%40\%. So a complete answer to "how reliable is this prediction" mentions both whether it is interpolation or extrapolation and how much variation the model explains.

Common errors
Interpreting the slope without units
Tie the slope to the variables, for example "66 extra coffees per degree", not just "the slope is 66".
Forcing an intercept interpretation
If x=0x = 0 is meaningless or far outside the data, say the intercept has no sensible interpretation.
Predicting without checking the range
Label every prediction interpolation or extrapolation and flag extrapolations as unreliable.
Putting the variables the wrong way round
Fit yy (response) on xx (explanatory); swapping them gives a different line and wrong predictions.

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 2021-style6 marks
For ten students, the least-squares line relating exam mark (yy, %) to hours studied (xx) is y=41.0+3.5xy = 41.0 + 3.5x, with data ranging over x=2x = 2 to x=12x = 12 hours. (a) Interpret the slope and intercept. (b) Predict the mark for 99 hours. (c) Comment on predicting the mark for 2020 hours.
Show worked answer →

Read the slope as the change per unit and the intercept as the value at x=0x = 0.

(a) Slope 3.53.5: each extra hour of study is associated with a 3.53.5 percentage-point increase in exam mark. Intercept 41.041.0: a student who studies 00 hours is predicted to score 41%41\%. (3 marks)

(b) x=9x = 9 lies inside the data range (22 to 1212), so this is interpolation: y=41.0+3.5(9)=41.0+31.5=72.5%y = 41.0 + 3.5(9) = 41.0 + 31.5 = 72.5\%. (2 marks)

(c) x=20x = 20 is far outside the data range, so predicting there is extrapolation and unreliable; the linear trend may not continue and a mark cannot exceed 100%100\%. (1 mark)

Markers reward slope-as-rate and intercept-in-context, a correct interpolation, and identifying extrapolation as unreliable.

WACE 2023-style5 marks
A least-squares line of weekly sales yy (units) on advertising spend xx ($ \$\,hundreds) is y=120+8xy = 120 + 8x. (a) Predict the sales for a spend of $1500\$1500. (b) The actual sales at that spend were 260260 units. Calculate the residual and state what it shows.
Show worked answer →

Use the line for the prediction, then compare with the observed value.

(a) A spend of $1500\$1500 is x=15x = 15 (hundreds), so y=120+8(15)=120+120=240y = 120 + 8(15) = 120 + 120 = 240 units predicted. (2 marks)

(b) Residual == observed −- predicted =260−240=20= 260 - 240 = 20. The positive residual shows the actual sales were 2020 units above the line, so the model underpredicted at that point. (3 marks)

Markers reward consistent units for xx, the prediction, and a residual defined as observed minus predicted.

Practise this

Sources & how we know this

ExamExplained