Resources For Teachers For Tutors For Students & Parents AI New Pricing
Year 10 Maths Advanced Single Variable and Bivariant Statistics

Line of Best Fit

20 practice questions 3 video lessons Theory + worked examples

A line of best fit is a straight line drawn through the middle of the points on a scatter plot, often through the mean point \((\bar{x},\bar{y})\). Its equation can be found from two points on it and used to make predictions. In NSW Year 10 Advanced maths you also judge whether a prediction is reliable (NESA outcome MA5‑DAT‑C‑02).

You will read points from a line of best fit, find its equation, and use it to predict values inside the data range (interpolation) and outside it (extrapolation). You will find the mean point, use a calculator to fit a line, and explain what the gradient means, such as the fuel cost per kilometre. Data include eucalyptus heights, foot length and height, July temperatures and elevation, and irrigation at a Bathurst orchard. It is part of Year 10 Advanced Single Variable and Bivariant Statistics.

Practice 20 questions
Practice questions

Every question with a fully worked solution.

Start practising
Watch 3 video(s)
  • Line of Best Fit - Video - Line of Best Fit (1 of 2) Watch
  • Line of Best Fit - Video - Line of Best Fit (2 of 2) Casio Calculator Watch
  • Line of Best Fit - Video - Line of Best Fit (2 of 2) Sharp Calculator Watch
Create a free accountTrack your progress and save your work as you go.
Create free account

Theory

A line of best fit (trend line) is a straight line that follows the pattern of a linear scatter plot. Its equation lets you predict one variable from the other, and its gradient and intercept describe the relationship. This Year 10 Advanced maths page covers drawing it by eye through the mean point, finding and interpreting its equation, predicting both ways, judging interpolation and extrapolation, and the least-squares line on a calculator.

A line of best fit is a straight line drawn through a scatter plot with a linear association so that the points are spread evenly either side of it. It need not pass through any data point.

The mean point \((\bar{x}, \bar{y})\) is a good point to draw the line through.

In \(y = mx + c\), the gradient \(m\) is the average change in \(y\) for each increase of \(1\) in \(x\); the intercept \(c\) is the predicted \(y\) when \(x = 0\) (which may or may not make sense).

A prediction inside the range of the data is interpolation; outside it is extrapolation, which is less reliable because the trend may change. The least-squares line is the line of best fit a calculator finds; it always passes through the mean point.

Line of best fit by eye through the mean pointEight points rising from left to right with a straight line drawn through their mean point. The points are balanced, with about half above the line and half below. x y mean point
Draw the line so the points are balanced either side of it, following the trend. A good line passes through (or very near) the mean point \((\bar{x}, \bar{y})\).
Interpolation and extrapolationA number line for x. The shaded section between the smallest x-value in the data, 10, and the largest, 45, is where predictions are interpolation. Beyond either end, predictions are extrapolation and are less reliable. 0102030405060 interpolation (inside the data) extra- polation extra- polation less reliable smallest x largest x
Predictions inside the range of the data are interpolation. Predictions outside it are extrapolation: the pattern may not continue.
\[m = \dfrac{y_2 - y_1}{x_2 - x_1} \qquad y - y_1 = m(x - x_1) \qquad (\bar{x}, \bar{y}) = \left(\dfrac{\sum x}{n},\ \dfrac{\sum y}{n}\right)\]
y−y1=m(x−x1)
Reading the line from a graph. Choose two points on the line (not data points) that are far apart and easy to read, often where it crosses grid lines. Use the line's own variable names, e.g. \(T = 3d + 12\), not \(y = 3x + 12\).
Working backwards. To find \(x\) for a given \(y\), substitute \(y\) and solve. If a budget is involved, first turn the money into the quantity (e.g. \(\$36\,000\) at \(\$450\) per unit is \(80\) units), then solve. A change in \(y\) of \(k\) goes with a change in \(x\) of \(\dfrac{k}{m}\).

Drawing and using a line of best fit

  1. Check the scatter plot shows a linear association (a curve needs a different model).
  2. Find the mean point and mark it.
  3. Draw a straight line through the mean point following the trend, with about as many points above as below.
  4. Equation: read two points on the line (or use the mean point and the intercept), find \(m\), then \(c\).
  5. Interpret \(m\) and \(c\) in words, with units.
  6. Predict: substitute \(x\) to find \(y\), or substitute \(y\) and solve for \(x\). Say whether it is interpolation or extrapolation.

With a calculator

  1. Statistics mode, linear regression. Enter the pairs and read \(m\) (or \(a\) or \(b\), depending on the model) and \(c\).
  2. Round only for the final equation; predictions from the unrounded values are slightly more accurate.
  3. For years, it is often easier to let \(x\) be the number of years after the first year.
Example 1 β€” Equation of a line drawn by eye
The table gives the age and value of seven used cars of the same model. A line of best fit has been drawn through the mean point and \((0, 33)\).
Age \(x\) (years)Value \(y\) (\(\$\) thousand)
\(1\)\(30\)
\(2\)\(27\)
\(3\)\(25\)
\(4\)\(21\)
\(5\)\(20\)
\(6\)\(16\)
\(7\)\(15\)
Car age and valueSeven points falling from (1, 30) to (7, 15), with a line of best fit through the mean point (4, 22) and the point (0, 33). age value 1 2 3 4 5 6 7 15 20 25 30 (4, 22)
(i) Find the mean point. (ii) Find the equation of the line. (iii) Interpret the gradient and the \(y\)-intercept. (iv) Predict the value of a \(5.5\)-year-old car.
Solution

(i) \(\bar{x} = \dfrac{28}{7} = 4\), \(\bar{y} = \dfrac{154}{7} = 22\). Mean point \(\boldsymbol{(4, 22)}\).

(ii) Through \((0, 33)\) and \((4, 22)\):

\(m\)\(=\)\(\dfrac{22 - 33}{4 - 0} = -2.75\)
\(y\)\(=\)\(\boldsymbol{-2.75x + 33}\)

(iii) Gradient: the value falls by about \(\$2750\) for each extra year of age. Intercept: a new car (\(x = 0\)) is worth about \(\$33\,000\).

(iv)

\(y\)\(=\)\(-2.75(5.5) + 33 = 17.875\)

About \(\boldsymbol{\$17\,900}\). This is interpolation (\(5.5\) is between \(1\) and \(7\)), so it is reasonably reliable.

y=−2.75x+33
Example 2 β€” Predicting both ways
For one phone model, a line of best fit for battery remaining, \(B\%\), against hours of video streaming, \(t\), passes through \((1, 88)\) and \((5, 40)\). The data covered \(0.5\) to \(6\) hours.
(i) Find the equation.
(ii) Predict \(B\) after \(3.5\) hours.
(iii) When does the line predict \(10\%\) left? Comment on its reliability.
Solution

(i)

\(m\)\(=\)\(\dfrac{40 - 88}{5 - 1} = -12\)
\(88\)\(=\)\(-12(1) + c \quad\Rightarrow\quad c = 100\)
\(B\)\(=\)\(\boldsymbol{100 - 12t}\)

(ii)

\(B\)\(=\)\(100 - 12(3.5) = \boldsymbol{58\%}\)

(iii) Solve for \(t\):

\(100 - 12t\)\(=\)\(10\)
\(12t\)\(=\)\(90\)
\(t\)\(=\)\(\boldsymbol{7.5}~\text{hours}\)

\(7.5\) hours is beyond the largest value in the data (\(6\) hours), so this is extrapolation and less reliable: batteries often drain faster or slower near empty.

B=100−12t
Example 3 β€” Least-squares line on a calculator
Six students recorded their daily typing practice and their typing speed.
Practice per day, \(x\) (min)Typing speed, \(y\) (words/min)
\(2\)\(15\)
\(4\)\(19\)
\(6\)\(26\)
\(8\)\(28\)
\(10\)\(35\)
\(12\)\(38\)

(i) Use a calculator to find the least-squares line of best fit, with values correct to \(2\) decimal places.
(ii) Predict the speed for \(7\) minutes of practice.
(iii) Comment on a prediction for \(20\) minutes.
Solution

(i) Statistics mode, linear regression (\(y = ax + b\) or \(y = mx + c\)). Enter \(x\) and \(y\) as pairs.

\(m\)\(=\)\(2.357\ldots \approx 2.36\)
\(c\)\(=\)\(10.333\ldots \approx 10.33\)
\(y\)\(=\)\(\boldsymbol{2.36x + 10.33}\)

(ii)

\(y\)\(=\)\(2.36(7) + 10.33 = 26.85 \approx \boldsymbol{26.9}~\text{words/min}\)

(The unrounded line gives \(26.8\); small differences like this come from rounding \(m\) and \(c\).)

(iii) \(x = 20\) is outside the data (\(2\) to \(12\) minutes): extrapolation. The line gives about \(57.5\) words/min, but speed is unlikely to keep rising at the same rate, so treat it with caution.

y=2.36x+10.33
Example 4 β€” The mean point is on the line
The line of best fit \(y = 3x + 2\) passes through the mean point of \((1, 6)\), \((2, 7)\), \((4, a)\), \((5, 18)\) and \((8, 25)\). Find \(a\).
Solution

Find \(\bar{x}\) from the known \(x\)-values, then use the line to get \(\bar{y}\).

\(\bar{x}\)\(=\)\(\dfrac{1 + 2 + 4 + 5 + 8}{5} = 4\)
\(\bar{y}\)\(=\)\(3(4) + 2 = 14\)

So the \(y\)-values add to \(5 \times 14 = 70\).

\(6 + 7 + a + 18 + 25\)\(=\)\(70\)
\(a\)\(=\)\(\boldsymbol{14}\)
y¯=3x¯+2

If the unknown is in the \(x\)-values as well, write \(\bar{x}\) and \(\bar{y}\) in terms of it and substitute both into the line.

Common pitfalls

Use points on the line, not data points. Two data points generally do not lie on the line of best fit, so they give a different equation.
Do not just join the first and last points. A line of best fit balances all the points; one end point may be unusual.
Extrapolation can be nonsense. A tree growing \(0.8\) m a year will not be \(80\) m tall at \(100\) years. Say why a prediction outside the data may fail.
The intercept may not make sense. If \(x = 0\) is outside the data, the intercept is just where the line crosses the axis, not a real value.
Association is not cause. A line of best fit describes a trend; it does not show that \(x\) causes \(y\).

Frequently asked questions

How do you draw a line of best fit?

Find the mean point and draw a straight line through it that follows the trend of the points, with roughly the same number of points above and below the line.

How do you find the equation of a line of best fit?

Choose two points on the line, find the gradient as rise over run, then substitute one point into y equals mx plus c to find c. Use the variable names from the question.

What is the difference between interpolation and extrapolation?

Interpolation predicts within the range of the data and is usually reliable. Extrapolation predicts outside that range and is less reliable, because the pattern may not continue.

What does the gradient of a line of best fit mean?

It is the average change in the y variable for each increase of 1 in the x variable, for example a drop of 2750 dollars in value for each extra year of age.

What is the least-squares line of best fit?

It is the line a calculator finds using linear regression. It fits the points as closely as possible overall and always passes through the mean point.