M
hscscienceMaths Std · Y12
0/100daily goal
0
L1 · 0 XP
KJ
Your weak spots
Insights load after your first practice round.
Module 5 · L06 of 8 ~30 min MST-12-S2-08 ⚡ +70 XP available

The Least Squares Regression Line

The AFL uses regression lines fitted to player performance data to build salary models, because least squares returns the same line from the same data every time instead of leaving it to judgement. It is not immune to a freak season, though: one extreme point can drag the line noticeably, which is why the data is inspected before the line is trusted. In this lesson you will interpret the equation $y = a + bx$ and understand what the gradient $b$ and y-intercept $a$ mean in real-world contexts.

Think first, If you could minimise the total prediction error for all points, what line would that give you? How is that different from drawing a line by eye?
0/5QUESTS
1

Orient to least squares regression

Connect fitted lines with the equation selected by least squares.

Worksheets

Practise this lesson

Three printable worksheets that build from foundations to mastery, or build your own from any module’s questions.

01
Think First, recall from memory
+5 XP warm-up

If you could minimise the total vertical distance between all data points and a line, what would that give you? How is this mathematically better than drawing a line of best fit by eye?

auto-saved
02
The big idea, the mathematically optimal line
+5 XP to read

The least squares regression line is the unique line that minimises the sum of the squared vertical distances from each data point to the line. It is given as $y = a + bx$.

$b$ is the gradient: for each one-unit increase in x, the predicted y changes by $b$ units. It is the rate of change.

$a$ is the y-intercept: the predicted value of y when x = 0. It may or may not have a meaningful real-world interpretation.

$$y = a + bx$$
$a$ = y-intercept (base value), $b$ = gradient (rate)
HSC notation
The HSC uses $y = a + bx$, not $y = mx + c$. The $a$ comes first (constant), then $bx$. Do not confuse the order.
Interpret b in context
"For each additional [unit of x], the predicted [y] increases/decreases by [b] [units]."
Interpret a carefully
The y-intercept is the predicted y when x = 0. Sometimes this is meaningful (e.g. base salary with zero experience), sometimes it is nonsensical (e.g. negative height).
03
What you will learn
Know

Key facts

  • The HSC equation form: $y = a + bx$
  • $b$ = gradient (rate of change); $a$ = y-intercept
  • How to substitute to find predicted values
Understand

Concepts

  • What $b$ means in the context of the two variables
  • When $a$ has a meaningful real-world interpretation
  • Why the regression line is "best" mathematically
Can do

Skills

  • Interpret $a$ and $b$ in context for a given equation
  • Substitute to predict y for a given x
  • Identify when the y-intercept is or is not meaningful
Beyond the syllabus. Finding the least-squares line with your calculator or a spreadsheet, interpreting a and b, and making contextual predictions are core. The formulas b = r × (s_y / s_x) and a = ȳ − b x̄, and the optimisation theory behind them, are optional — the exam does not require manual calculation of the line.
04
Key terms, least squares regression
Least squares regression lineThe line that minimises the sum of the squared vertical distances from each data point to the line. The "best" fit in a mathematical sense.
$y = a + bx$HSC notation for the regression line. $a$ is the y-intercept (constant), $b$ is the gradient (coefficient of x).
Gradient ($b$)The rate of change, how much y changes for each one-unit increase in x. Can be positive (y increases) or negative (y decreases).
y-intercept ($a$)The predicted value of y when x = 0. May or may not have a meaningful real-world interpretation.
Predicted valueThe y value calculated by substituting an x value into the regression equation, not necessarily the actual observed y.
2

Read the regression equation

Identify the response, predictor, gradient and intercept in y = a + bx.

05
The equation $y = a + bx$, what each part means
MST-12-S2-08 core

The regression equation $y = a + bx$ has two components that are always interpreted in the context of the variables being studied:

The y-intercept $a$: the value of y when $x = 0$. This is the "starting value" or "base value." For example, if $y = 42 + 3.5x$ (where x = hours studied, y = exam score), then $a = 42$ means "a student who studied 0 hours is predicted to score 42%." This may represent prior knowledge.

The gradient $b$: the rate of change. For each 1-unit increase in x, y changes by $b$ units. For $y = 42 + 3.5x$, $b = 3.5$ means "for each additional hour of study, the predicted score increases by 3.5 percentage points."

HSC notation alert: The exam uses $y = a + bx$, not $y = mx + b$. In this notation, $a$ is always the constant (intercept) and $b$ is always the coefficient of x (gradient).

The least-squares regression equation is y = a + bx, where a is the y-intercept (predicted y when x = 0) and b is the gradient (change in y per unit increase in x). Both a and b are calculated from the data.

Pause, copy y = a + bx with definitions: a = y-intercept (value of y when x = 0) and b = gradient (change in y per unit increase in x), plus the formulas b = r × (s_y / s_x) and a = ȳ − bx̄ into your book.

Quick check: For the equation $y = 15 + 4x$ (where x = advertising spend in $\$000$s, y = monthly sales in $\$000$s), what does the value 4 represent?

3

Interpret the gradient

State the predicted change in the response for each unit change in the predictor.

06
Interpreting $b$, the gradient in context
MST-12-S2-08 core

The least-squares regression line is written y = a + bx, where a is the y-intercept and b is the gradient. The gradient b answers the question "how much does y change per unit increase in x?", for example, if b = 3.5 on a study-hours vs score plot, each extra hour of study is associated with 3.5 more percentage points in the exam score.

The gradient $b$ tells you the rate of change how much y changes for every one-unit increase in x.

Positive $b$: As x increases, y increases. Example: $b = 3.5$ with x = hours of study, y = score → "for each additional hour of study, the predicted score increases by 3.5 points."

Negative $b$: As x increases, y decreases. Example: $b = -2.4$ with x = temperature, y = hot coffee sales → "for each 1°C increase in temperature, predicted coffee sales decrease by 2.4 units."

Units: The gradient has units of $\frac{\text{units of y}}{\text{units of x}}$. For score (%) per hour (h), the gradient is in %/h.

Exam trap: Students often confuse b and a. Remember: b is the number in front of x (it multiplies x). a is the standalone number (added to bx).

The gradient b represents the rate of change: for every 1-unit increase in x, y changes by b units. If b is positive, y increases with x; if negative, y decreases. Always state b in context using the variable names and units.

Pause, copy the gradient interpretation template: "For each extra [x-unit] increase in [x-variable], [y-variable] is predicted to [increase/decrease] by b [y-unit]", and write one example using the lesson's context into your book.

Which does NOT belong? Correct interpretations of $b = -3$ in the equation $y = 50 - 3x$ (x = absences, y = grade %):

4

Interpret the intercept

Decide when the model value at x = 0 is meaningful.

07
Interpreting $a$, when the y-intercept makes sense
MST-12-S2-08 core

The gradient b = rate of change per unit of x is always safe to interpret. The y-intercept a = predicted y when x = 0 is trickier: if x = 0 is outside the realistic range of the data (e.g., zero rainfall in a study of rainfall vs plant growth), then a has no practical meaning and should not be interpreted, state this limitation explicitly.

The y-intercept $a$ is the predicted value of y when $x = 0$. Whether this is meaningful depends on the context:

Meaningful: If x = 0 is a realistic or relevant value.

  • $y = 42 + 3.5x$ (study hours vs score): $a = 42$ means a student who studies 0 hours is predicted to score 42%. This could represent prior knowledge, reasonable.
  • $y = 1800 + 250x$ (years of experience vs salary): $a = 1800$ is the predicted starting salary with 0 years of experience. Realistic.

Not meaningful: If x = 0 is unrealistic or outside the data range.

  • $y = -15 + 2x$ (height in cm vs weight in kg for children): $a = -15$ means a child of height 0 cm weighs −15 kg. Nonsensical, x = 0 is far outside the data range.

The y-intercept a is the predicted y-value when x = 0. It is only meaningful in context if x = 0 is physically possible. If x = 0 is outside the data range, do not interpret a as a real-world prediction.

Pause, copy the y-intercept rule: a gives the predicted y when x = 0, and note the condition: only interpret a in context if x = 0 is within the realistic range of the data; otherwise state it has no practical meaning into your book.

Complete: In the equation $y = a + bx$, the value $b$ represents the and tells us the change in $y$ for each in $x$.

5

Calculate the regression line

Use calculator and spreadsheet tools to obtain a and b.

08
Producing $a$ and $b$ yourself, on a scientific calculator
MST-12-S2-08 core

Every equation so far in this lesson was handed to you already finished. The exam hands you the data instead. You are not expected to minimise anything by hand, the calculator does that, and the marks are for entering the pairs correctly and reading the right two values off the screen.

The eight students from Lesson 3, their paid work hours ($x$) and their exam mark ($y$):

Work hours ($x$)035810121519
Exam mark ($y$)8976838274696950

On a Casio fx-82AU PLUS II:

  1. MODE then 2 for STAT , then 2 for A+BX . That setting name is the equation you are about to get.
  2. Type the eight $x$ values down the X column and the eight $y$ values down the Y column, keeping every pair on its own row.
  3. AC , then SHIFT 1 , then 5 for Reg .
  4. 1 gives $A = 89.3$ . Return to the same menu and 2 gives $B = -1.7$ .

Written out, the least-squares regression line is $y = 89.3 - 1.7x$ .

The calculator already uses the exam's notation. The mode is called A+BX because it returns $y = A + Bx$ , which is the $y = a + bx$ of card 05 with capital letters. $A$ is the intercept and $B$ is the gradient, in that order. Students lose marks by reading the first number on the screen as the gradient, because in $y = mx + b$ habits the gradient comes first. Here it does not.
The check that catches a data-entry error. The least-squares line always passes through the mean point $(\bar{x}, \bar{y})$ , exactly, with no rounding. For this data $\bar{x} = 9$ and $\bar{y} = 74$ , and $89.3 - 1.7 \times 9 = 89.3 - 15.3 = 74$ . If your own $A$ and $B$ fail this test on your own means, a pair was mistyped, and no amount of careful interpreting afterwards will rescue the answer.

Reading it back: $b = -1.7$ means each extra hour of paid work per week is associated with a predicted drop of $1.7$ marks. $a = 89.3$ is the predicted mark for a student doing no paid work, and here $x = 0$ is genuinely in the data, so unlike many of the examples in card 07 this intercept is worth interpreting.

To get the least-squares line on a scientific calculator, enter two-variable STAT mode, type the pairs into the X and Y columns, then read A and B from the regression menu and write y = A + Bx. A is the intercept and B is the gradient, in that order. Check the line by confirming it passes through the mean point (x̄, ȳ).

Pause, copy your own calculator's key sequence for reaching $A$ and $B$ , the reminder that $A$ is the intercept and $B$ the gradient, and the mean-point check into your book.

Quick check: A calculator in A+BX mode returns $A = 12.4$ and $B = 0.8$ . What is the regression equation?

09
The same regression in a spreadsheet
MST-12-S2-08 core

A spreadsheet does the same job as the calculator and adds the picture. Put the work hours in A2:A9 and the marks in B2:B9 , then build it two ways and make the two agree.

The chart. Select both columns, insert a Scatter chart, then add a Linear trendline and tick Display equation on chart . The equation printed on the chart is $y = -1.7x + 89.3$ , the same line as the calculator with the terms in the other order.

The three functions. These give the same numbers without touching a chart:

FormulaReturnsWhat it is
=CORREL(A2:A9,B2:B9)$-0.8996$Pearson's $r$ , matching Lesson 3
=SLOPE(B2:B9,A2:A9)$-1.7$the gradient $b$
=INTERCEPT(B2:B9,A2:A9)$89.3$the intercept $a$
Look hard at the argument order. SLOPE and INTERCEPT want the $y$ range first and the $x$ range second, which is the opposite of the order you read a coordinate in and the opposite of CORREL , where the order does not matter at all. Writing =SLOPE(A2:A9,B2:B9) returns $-0.476$ . It does not warn you. It is simply the wrong line.
The check that catches a broken model. Put =INTERCEPT(B2:B9,A2:A9)+SLOPE(B2:B9,A2:A9)*AVERAGE(A2:A9) in a spare cell and compare it with =AVERAGE(B2:B9) . The two must be identical, because the least-squares line passes through the mean point. Here both give $74$ . With the arguments reversed the same cell returns $39.94$ against a mean of $74$ , and the error announces itself.

Three tools, one line: the calculator's $A$ and $B$ , the trendline equation on the chart, and the SLOPE and INTERCEPT cells must all agree. If any one of them disagrees with the other two, that is the one to re-enter.

In a spreadsheet, a scatter chart plus a linear trendline with its equation displayed gives the least-squares line. CORREL returns r, SLOPE returns the gradient and INTERCEPT returns the intercept, but SLOPE and INTERCEPT take the y range first and the x range second. Check the result by confirming the line passes through the mean point.

Pause, copy the three formulas with their argument order, and copy the mean-point check cell that catches a reversed argument list.

6

Apply least squares regression

Work examples, interpret a fitted equation and revisit the opening question.

PROBLEM 1 · INTERPRET a AND b

The regression equation for hours studied (x) vs exam score % (y) is $y = 42 + 3.5x$. Interpret $a$ and $b$ in context.

1
$a = 42$: the y-intercept. When x = 0 (a student studies 0 hours), the predicted score is 42%.
The y-intercept is the constant: the predicted y when x equals zero.
PROBLEM 2 · PREDICT USING THE EQUATION

Using $y = 42 + 3.5x$, predict the score for a student who studies 8 hours.

1
Substitute $x = 8$: $y = 42 + 3.5(8) = 42 + 28 = 70$.
Replace x with the given value and calculate.
PROBLEM 3 · EXPLAIN b IN CONTEXT

For a regression of years of experience (x) vs annual salary $\$k$ (y), the equation is $y = 38 + 2.8x$. Explain what $b = 2.8$ means in context.

1
$b = 2.8$ is the gradient. It represents the change in predicted salary for each additional year of experience.
Identify what b is (gradient) before interpreting it.
10
Activity, interpret and use the regression equation

The regression equation for daily temperature °C (x) vs electricity demand in MWh (y) for a city is $y = 420 - 8.5x$.

  1. Interpret $a = 420$ in context.
  2. Interpret $b = -8.5$ in context.
  3. Predict electricity demand on a 25°C day.
  4. Does $b < 0$ make sense in this context? Explain.
auto-saved
11
Revisit your thinking

The least squares regression line minimises the sum of the squared vertical distances from the data points to the line. Squaring penalises large errors far more than small ones, so a point that sits well away from the trend pulls the line towards itself more than you might expect, not less. This mathematical optimisation ensures the line is the best possible linear prediction, better than any line drawn by eye.

auto-saved
7

Answer regression questions

Interpret and use least-squares equations in short-answer questions.

02
Short answer
ApplyBand 33 marks

Q1. The regression equation for weekly rainfall (mm) (x) vs monthly crop yield (tonnes) (y) is $y = 12 + 0.8x$. (a) Interpret $a = 12$ in context. (b) Interpret $b = 0.8$ in context. (c) Predict the crop yield in a week where 30 mm of rain falls. (3 marks)

auto-saved
AnalyseBand 42 marks

Q2. For a regression of weight (kg) (x) vs height (cm) (y) for babies aged 0–12 months, the equation is $y = -12 + 8.5x$. Explain whether the y-intercept $a = -12$ has a meaningful interpretation. (2 marks)

auto-saved
Answers (click to reveal)

Activity: (1) When temperature = 0°C, predicted electricity demand = 420 MWh (base demand in cold weather with no cooling needed). (2) For each 1°C increase in temperature, electricity demand decreases by 8.5 MWh (warmer weather reduces heating demand). (3) $y = 420 - 8.5(25) = 420 - 212.5 = 207.5$ MWh. (4) Yes, $b < 0$ makes sense, warmer temperatures reduce heating demand, so electricity usage decreases.

Q1 (3 marks): (a) $a = 12$ means: when rainfall = 0 mm, predicted crop yield is 12 tonnes (base yield from irrigation/soil moisture) [1]. (b) $b = 0.8$ means: for each additional mm of rainfall, predicted crop yield increases by 0.8 tonnes [1]. (c) $y = 12 + 0.8(30) = 12 + 24 = 36$ tonnes [1].

Q2 (2 marks): $a = -12$ does not have a meaningful interpretation [1]. A baby with weight = 0 kg cannot have a height of −12 cm. Since x = 0 is outside the realistic data range for babies, the y-intercept is a mathematical artefact of the equation, not a meaningful real-world value [1].