π Line of best fit
The rule
- A line of best fit is a straight line through the middle of the dots, with about as many dots above as below.
- You can draw it by eye or use a computer. Two good lines are close, but not always the same.
- Its equation is y = mx + c. m is the gradient: how much y changes when x goes up by 1. c is the value of y when x = 0.
- To find m, pick two points on the line, not two dots: m = (yβ β yβ) Γ· (xβ β xβ). Then put one point into y = mx + c to find c.
- To predict, put your x into the equation and work out y.
- Interpolation predicts inside the range of the data. It is fairly reliable.
- Extrapolation predicts outside the range. The pattern may not carry on, so it is risky.
- Tight dots give a trustworthy line. Loose dots give a rougher line and rougher predictions.
Examples
The line is y = 6x + 30 (mark from hours). Predict the mark at 5 hours. β 60
- Put x = 5 in.
- y = 6 Γ 5 + 30
- y = 30 + 30 = 60
Put x = 5 into the equation. m multiplies x, then c is added.
A line passes through (2, 7) and (6, 15). Find its equation. β y = 2x + 3
- m = (15 β 7) Γ· (6 β 2) = 8 Γ· 4 = 2
- y = 2x + c. Put in (2, 7): 7 = 2 Γ 2 + c
- 7 = 4 + c, so c = 3
- y = 2x + 3
Find m from the two points, then find c from one of them.
A car's price ($000) is y = β2x + 30, where x is its age. Find the price at age 6. β $18 000
- Put x = 6 in.
- y = β2 Γ 6 + 30
- y = β12 + 30 = 18
- The price is about $18 000.
Put x = 6 into the equation. A negative gradient means the price falls.
Same car line. The data covers ages 1 to 10. Predict the price at age 20. Trust it? β β10, so no: it is impossible
- y = β2 Γ 20 + 30 = β10
- A price of β10 is impossible.
- Age 20 is beyond the data (ages 1 to 10): extrapolation.
- Do not trust it.
Age 20 is outside the data. Extrapolation can give nonsense.
Watch out
- βThe line must pass through every dot.β No: it balances the dots, some above and some below.
- βAt x = 5, y = 6x + 30 is 6 + 5 + 30.β No: m multiplies x. It is 6 Γ 5 + 30.
- βPredicting at x = 40 is as reliable as at x = 5.β No: beyond the data, the pattern may not hold.
- βc is where the line meets the x axis.β No: c is where it meets the y axis, at x = 0.