Lines of Best Fit — Print
One line drawn through the middle of the cloud, then read like any other line: slope and intercept, with units.
What the practice questions cover
These questions use 9 ideas from the course. Follow any of them for a definition, where it is taught, and what it leads to.
- Rate — A ratio of two different units, like miles per hour or dollars per pound.
- Mean — Two kinds of centre: the balance point, and the middle value.
- Slope — How much y changes for each 1 that x increases.
- Range — The set of outputs that actually occur.
- Line of best fit — A straight line summarising a linear pattern in a scatter plot.
- Interpolation — Predicting inside the range of the data. Usually safe.
- Extrapolation — Predicting outside the range. Risky.
- Residual — The gap between an actual value and the line's prediction.
- Height — The perpendicular distance from the base to the opposite corner.
The cloud drifts upward, but no single line goes through every dot. So which line do you draw?
Lay a ruler through the middle of the cloud. Roughly half the dots should end up above it and half below.
The little gaps are the misses — how far each real child sat from what the line predicted.
A good line keeps those gaps small and balanced. A line dragged towards one stray dot makes most of the other gaps worse.
That is all a line of best fit is: a summary. Its slope tells you the typical gain per extra hour, and its intercept the predicted score at zero hours — both with units, and neither one a claim about cause.
Drawing the line
Aim for the middle of the cloud, with roughly half the dots above and half below, following the direction of the pattern.
It does not have to touch any dot. It must not be dragged by a single outlier.
Draw it right across the plot with a ruler so you can read off values at either end.
Squint at the plot
Step back and half-close your eyes so the dots blur into a band. Draw your line down the middle of that band. This works better than any amount of point-by-point fiddling.
Finding its equation
Pick two points on your line — not two data points — that sit on convenient grid crossings.
Find the slope from them, read the y-intercept, and write y = mx + b.
Two people will get slightly different lines from the same data. Both can be right.
Use the line, not the dots
The whole point of the line is that it smooths out the dots. Computing the slope from two raw data points defeats it.
Saying what the numbers mean
The slope is the predicted change in y for every one-unit increase in x — with units attached.
"The slope is 4.5" is half an answer. "Each extra hour of practice is associated with about 4.5 more points" is a full one.
The intercept is the prediction when x = 0. Sometimes that is meaningful; sometimes it is nonsense, like a newborn weighing -2 kg.
"Associated with", not "causes"
The line is a summary of what happened together. It still does not establish cause.
Predicting, and knowing when not to
Substitute an x inside the data range and read off the prediction. That is interpolation, and it is reasonable.
Substituting an x far outside the range is extrapolation. The pattern may simply stop holding.
A line fitted to children aged 5 to 12 will confidently predict that a 40-year-old is 3 metres tall. The arithmetic is fine; the prediction is nonsense.
Worked examples
Equation from a fitted line
A line of best fit passes through (0, 20) and (10, 65). Write its equation.
- b = 20, from the point with x = 0. That is the y-intercept.
- m = 65 - 2010 - 0 = 4510 = 4.5 Rise over run between the two line points.
- y = 4.5x + 20 Slope-intercept form.
y = 4.5x + 20
Interpreting the slope
For y = 4.5x + 20, where x is hours practised and y is score, what do 4.5 and 20 mean?
- The slope 4.5 is points per hour. Units of y divided by units of x.
- Each additional hour of practice is associated with about 4.5 more points. Say "associated with", not "causes".
- The intercept 20 predicts the score with no practice at all. Meaningful here, since zero hours is possible.
4.5 points per hour; 20 points predicted with no practice
When prediction fails
The data covers 0 to 10 hours. Use y = 4.5x + 20 to predict the score after 40 hours, and comment.
- y = 4.5(40) + 20 = 200 The arithmetic is straightforward.
- But 40 is far outside the 0–10 range. That is extrapolation.
- And a score of 200 is likely impossible anyway. Most tests stop at 100.
- So the prediction is not trustworthy. The linear pattern almost certainly flattens out.
200 — arithmetically correct, but an unsafe extrapolation
Words to know
- Line of best fit
- A straight line summarising a linear pattern in a scatter plot.
- Interpolation
- Predicting inside the range of the data. Usually safe.
- Extrapolation
- Predicting outside the range. Risky.
- Residual
- The gap between an actual value and the line's prediction.
Mistakes to watch for
Computing the slope from two data points. The whole purpose of the line is to smooth out individual dots, so its slope must come from two points on the line — ideally on grid crossings, far apart.
Tilting the line to chase an outlier. One unusual dot should not move the summary of the other twenty. If your line no longer splits the cloud in half, it is being pulled.
Giving the slope as a bare number. "4.5" is half an answer; "about 4.5 more points for each extra hour of practice" is a whole one. Slope is a rate, and a rate without units means nothing.
Extrapolating far beyond the data and trusting it. A line fitted to children aged 5 to 12 will confidently predict a 40-year-old is three metres tall. The arithmetic is fine — the assumption that the pattern continues is not.
The least-squares method — choosing the line that makes the squared gaps as small as possible — was published by Legendre in 1805.
Gauss then claimed he had been using it since 1795, which caused a long and bitter priority dispute.
Gauss had used it for something spectacular: predicting where the lost asteroid Ceres would reappear. Astronomers pointed their telescopes where he said, and there it was.
Problem 1
A line of best fit passes through (0, 12) and (4, 24). Find its equation.
Worked answer
y = 3x + 12
b = 12
m = 24 - 124 = 3
y = 3x + 12
Problem 2
A line of best fit passes through (0, 50) and (10, 30). Find its equation.
Worked answer
y = -2x + 50
b = 50
m = 30 - 5010 = -2
y = -2x + 50
Problem 3
For y = 4x + 15, predict y when x = 6.
Worked answer
39
4(6) + 15
= 24 + 15 = 39
Problem 4
For y = 2.5x + 8 where x is hours and y is dollars, what does 2.5 mean?
Worked answer
2.50 per hour
Dollars per hour
$2.50 for each extra hour
Problem 5
For y = 6x + 20 where x is days of growth, what does 20 mean?
Worked answer
the starting value at day 0
At x = 0, y = 20
So the plant began at 20
Problem 6
A line predicts y = 34 but the actual value was 40. Find the residual.
Worked answer
6
40 - 34 = 6
Positive, so the point sits above the line
Problem 7
A line predicts y = 88 but the actual value was 81. Find the residual.
Worked answer
-7
81 - 88 = -7
Negative, so the point sits below the line
Problem 8
A line of best fit is y = -1.5x + 60. Predict y when x = 12.
Worked answer
42
-1.5(12) = -18
-18 + 60 = 42
Problem 9
Data covers x from 2 to 15. Predicting at x = 80 is
- extrapolation, and unsafe
- interpolation, and safe
- impossible to compute
- the same as the mean
Worked answer
extrapolation, and unsafe
80 is far outside 2 to 15
That is extrapolation
The pattern may not continue
Problem 10
For the line y = 5x + 10, at what x does y reach 60?
Worked answer
10
5x + 10 = 60
5x = 50
x = 10
Problem 11
Line A has residuals 1, -2, 2, -1. Line B has residuals 6, -5, 4, -5. Which fits better?
- A
- B
- Equally well
- Cannot be determined
Worked answer
A
A misses by at most 2
B misses by up to 6
So A fits better
Problem 12
A best-fit line for temperature (°F) against altitude (thousands of feet) has slope -3.5. Interpret it.
Worked answer
temperature drops 3.5 degrees per thousand feet
Negative means it falls
Each extra thousand feet drops it 3.5°F
Problem 13
A best-fit line passes through (3, 17) and (8, 42). Find its equation.
Worked answer
y = 5x + 2
m = 42 - 178 - 3 = 5
17 = 5(3) + b, so b = 2
y = 5x + 2
Problem 14
A line is y = 3x + 4. A data point is (5, 22). Find the residual.
Worked answer
3
Predicted: 3(5) + 4 = 19
Residual: 22 - 19 = 3
Problem 15
A best-fit line for a child's height against age gives y = 2.4x + 30 inches. Predict the height at age 40 and say whether to trust it.
Worked answer
126 inches, not trustworthy
2.4(40) + 30 = 126 inches
That is over 10 feet
Far outside the data range, so an unsafe extrapolation
Problem 16
Two students fit lines to the same data. One gets y = 2x + 5, the other y = 2.1x + 4.6. Can both be reasonable? Answer yes or no.
Worked answer
yes
Both pass through the middle of the cloud
Slightly different lines can both summarise it well
So yes