Year 9 · Unit 5 Scatter graphs and correlation · Lesson 4 of 6

Using a line of best fit to predict

Find the equation from two points on the line, use it to predict, and know when the prediction has gone past the data.

Statistics and ProbabilityNo calculator

Warm-up

Three quick ones from earlier work. Try each in your head or on paper before you open the answer.

  1. Find the gradient of the line through (1, 3) and (5, 11).
    Answer(11 − 3) ÷ (5 − 1) = 2.
  2. A line is y = 3x + 4. What is y when x = 6?
    Answer22, because 3 × 6 + 4 = 22.
  3. The mean point of a data set is (6, 21). What do 6 and 21 stand for?
    Answer6 is the mean of the x values and 21 is the mean of the y values.
Words used in this lesson
gradient
how much y changes for one step in x. For example: 6 cm each year.
intercept
the value of y where the line meets x = 0. For example: 78.
interpolation
predicting inside the range of the data. For example: age 8.5.
extrapolation
predicting outside the range of the data. For example: age 40.
prediction
a value worked out from a line or model, not measured. For example: 120 cm at age 7.

What would the line say at 40?

A doctor measures eight children aged 3 to 10 and draws a line of best fit, y = 6x + 78, for height in centimetres against age in years. A reporter uses it to say how tall a 40-year-old would be. Before you read on: what does the line give, and would you trust it?

A line of best fit has an equation y = mx + c. The gradient m is the change in y for one step in x, found from two points on the line: m = (y2 − y1) ÷ (x2 − x1). Then c = y − mx for either point.

Interpolation (predicting inside the range of the data) is reasonable. Extrapolation (predicting outside it) is a guess, and the further out, the worse.

Slide the age from 3 to 40. Say whether you would trust each prediction before you read the label.

7
120height the line gives, in cm
inside the datainside or outside the measured ages
reasonablehow far to trust it

Age 7: the line gives 6 × 7 + 78 = 120 cm. This is inside the data: interpolation, a reasonable prediction.

Show me the steps
  1. Age 7 is inside the data (3 to 10): the line gives 6 × 7 + 78 = 120 cm. A reasonable prediction, called interpolation.
  2. Age 12 is just outside the data: 6 × 12 + 78 = 150 cm. It may be close, but it is a guess beyond what was measured, called extrapolation.
  3. Age 25: 6 × 25 + 78 = 228 cm. Growth slows and stops in the late teens, so the line no longer applies.
  4. Age 40: 6 × 40 + 78 = 318 cm, taller than any person on record. The line has been pushed far past its data.

Two slips to watch for. Take the two points from the line, not from two data dots, which are scattered about it. And always ask whether the predicted value is possible: a line can give heights nobody has.

Worked examples

The line passes through (4, 102) and (10, 138). Find its equation.

  1. Gradient: (138 − 102) ÷ (10 − 4) = 36 ÷ 6 = 6.
  2. Intercept: c = 102 − 6 × 4 = 102 − 24 = 78.
  3. The equation is y = 6x + 78.

Predict the height at age 8.5 and at age 16. Which is more reliable?

  1. Age 8.5: 6 × 8.5 + 78 = 51 + 78 = 129 cm. It is inside 3 to 10: interpolation.
  2. Age 16: 6 × 16 + 78 = 96 + 78 = 174 cm. It is outside 3 to 10: extrapolation.
  3. The age 8.5 prediction is more reliable, because it lies inside the data.

Your go. The first step is given. A line passes through (1, 20) and (5, 52). Find its equation.

  1. The rise is 52 − 20 = 32 and the run is 5 − 1 = 4, so the gradient is 32 ÷ 4.
  2. Work out the gradient, then c = 20 − gradient × 1.
Check the answer

Gradient 8 and c = 20 − 8 = 12, so y = 8x + 12.

Check before you go on

1. A line of best fit passes through (2, 14) and (8, 41). Which calculation gives its gradient?

Your turn

Start at Level 1 and go as far as you can. Type negative numbers with a minus sign, for example -7. A wrong answer gets a reason, not just a cross: read it, then try again.

Level 1 · Getting started

2. A line of best fit is y = 5x + 20. What y does it give at x = 12?

3. A line of best fit is y = 4x + 15. What y does it give at x = 9?

Level 2 · Building

4. Two points on a line of best fit are (3, 21) and (9, 45). What is the gradient of the line?

5. A line has gradient 4 and passes through (3, 21). What is c in y = 4x + c?

6. The line y = 4x + 9 was built from data with x from 3 to 12. Predict y at x = 7.5.

Level 3 · Stretch

7. Using y = 6x + 78 for height in cm at age x, at what age does the line predict a height of 200 cm? Give your answer to one decimal place.

8. A seedling's height in cm is modelled by y = 2.5x + 10, built from data for weeks 1 to 8. A pupil uses the line for week 52. How many weeks beyond the last week of data is week 52?

Something to think about

The line says a child aged 0 would be 78 cm tall. Newborn babies are about 50 cm long. Is the equation wrong, or is it being used wrongly?

One way to think about it

The equation fits the data it was built from, ages 3 to 10. Age 0 is outside that range, so the line is being extrapolated and the intercept 78 does not describe newborns. The model is fine inside the data and unreliable outside it.

Exit ticket

9. Fuel used (litres) against distance (km) was measured for trips of 20 km to 300 km, giving y = 0.08x + 1.5. Which prediction is the most reliable?