Lines of best fit
Drawing a line of best fit by eye, finding its equation, using it to make predictions, interpolation and extrapolation, and linear regression with technology.
When a scatter plot shows a linear pattern, a single straight line can summarise all the points. Once you have its equation, you can predict: how far a car will travel on $30$ L of fuel, or what score a student might get after $6$ hours of study.
Drawing a line by eye
A line of best fit follows the trend of the points. It doesn't have to pass through any of them, and it doesn't have to go through the origin. A good rule: about as many points above the line as below, spread evenly along its length.
Change the gradient m and the y-intercept c to fit the points.
Adjust $m$ and $c$ until the line runs through the middle of the points, with about as many above as below. Write down your equation. Then compare it with the regression line from a calculator, $y \approx 2.43x + 10.07$. How close were you, and how different are your two predictions at $x = 10$?
Finding the equation
Pick two points that lie on your line (not data points, unless the line happens to pass through them), far apart for accuracy. Then use the gradient formula and $y = mx + c$, as for any straight line.
A line of best fit for hours of study ($x$) and test score ($y$) passes through $(2, 50)$ and $(8, 80)$. Find its equation and explain what the gradient means.
Predictions: interpolation and extrapolation
Using $y = 5x + 40$ from data with $1$ to $9$ hours: $5$ hours predicts $65$ marks (interpolation). $15$ hours predicts $115$ marks, which is impossible on a test out of $100$. The line can't be trusted that far out.
Regression with technology
Different people draw slightly different lines by eye. A calculator or spreadsheet finds one exact line, the least-squares regression line. It is the line that makes the squared vertical distances from the points to the line as small as possible. In a calculator's statistics mode, enter the $x$ and $y$ values and choose linear regression. It reports values $a$ and $b$ for $y = a + bx$, where $b$ is the gradient and $a$ is the $y$-intercept.
Your turn
A line of best fit for a car's age ($x$ years) and its value ($y$ thousand dollars) passes through $(1, 28)$ and $(6, 13)$. Find its equation and predict the value at $4$ years.
Show the working
$m = \dfrac{13 - 28}{6 - 1} = \dfrac{-15}{5} = -3$. Then $28 = -3(1) + c$, so $c = 31$ and $y = -3x + 31$. At $x = 4$: $y = -12 + 31 = 19$, so about $\$19\,000$. The car loses about $\$3000$ of value per year.
A good line of best fit should:
It follows the trend through the middle of the points. It doesn't have to pass through any particular point.
A line of best fit is $y = 2.5x + 10$. Predict $y$ when $x = 6$.
$y = 2.5 \times 6 + 10 = 15 + 10 = 25$.
A line of best fit passes through $(2, 50)$ and $(8, 80)$. Find its gradient.
$m = \dfrac{80 - 50}{8 - 2} = \dfrac{30}{6} = 5$.
For the line in the previous question, find the $y$-intercept.
$50 = 5 \times 2 + c$, so $c = 40$.
Data was collected for $x$ from $10$ to $50$. Using the line to predict at $x = 35$ is:
$35$ is inside the range $10$ to $50$, so it is interpolation.
The line $\text{score} = 5 \times \text{hours} + 40$ has gradient $5$. This means:
The gradient is the change in score for each extra hour.
The value $y$ (in thousands of dollars) of a boat of age $x$ years follows $y = -1.5x + 40$. Predict the value at $12$ years, in thousands of dollars.
$y = -1.5 \times 12 + 40 = -18 + 40 = 22$.
A line of best fit is $y = 3x + 7$. For what value of $x$ does it predict $y = 31$?
$3x + 7 = 31$, so $3x = 24$ and $x = 8$.
Challenge: a line of best fit passes through $(10, 62)$ and $(30, 47)$. Use it to predict $y$ when $x = 22$.
$m = \dfrac{47 - 62}{30 - 10} = \dfrac{-15}{20} = -0.75$. From $(10, 62)$, $x$ increases by $12$, so $y$ changes by $-0.75 \times 12 = -9$. Prediction: $62 - 9 = 53$.
Challenge: a line fitted to children's heights for ages $2$ to $12$ predicts a height of $320$ cm at age $40$. The best comment is:
Age $40$ is far outside $2$ to $12$. Growth stops in the late teens, so the linear trend doesn't continue.
Coaching Centre