Resources For Teachers For Tutors For Students & Parents Pricing
Year 12 Maths Standard 1 (2027) Bivariate data analysis

Line of Best Fit

20 practice questions 0 video lessons Theory + worked examples

Learn to draw a line of best fit for NSW Year 12 Mathematics Standard 1 (NESA outcome MST-12-S1-06). It is one straight line that follows the trend of a scatter plot, with about as many points above it as below, summing up how two variables are related.

You will fit the line by hand and with technology, read its gradient and \(y\)-intercept, write its equation, and explain what each number means in context — for example, how much a plant grows each extra week, or its height at the start.

Create a free accountTrack your progress and save your work as you go.
Create free account

Theory

A line of best fit is one straight line drawn by eye through the middle of a scatter plot, with about as many points above it as below. This Year 12 Standard 1 (NSW) guide shows how to read its y-intercept \(c\) and gradient \(m\), write the equation \(y=mx+c\) and explain what each number means in context.

A line of best fit is one straight line drawn by eye that follows the trend of a scatter plot, staying close to as many points as possible with roughly equal numbers of points above and below. It does not have to pass through any point. A line of best fit can also be drawn with digital tools (a spreadsheet trendline or a graphing app), which give the equation directly.

The y-intercept \(c\) is where the line crosses the vertical axis (the value when \(x=0\)). The gradient \(m\) is the rise divided by the run, found from two points on the line.

The equation is \(y=mx+c\); use the letters of the problem, e.g. \(H=mw+c\). In context, \(m\) is the change in \(y\) for each extra \(1\) unit of \(x\), and \(c\) is the value the model gives when \(x=0\).

Line of best fit y = 2x + 3Eight points with a red line of best fit crossing the y-axis at 3; a dashed triangle shows rise 16 over run 8. 1 2 3 4 5 6 7 8 4 8 12 16 20 x y run = 8 rise = 16 c = 3
The line balances the points (\(4\) above, \(4\) below): \(c=3\), \(m=16\div8=2\), so \(y=2x+3\).
Joining the dots is not a line of best fitThe same points joined by a zig-zag line, which is wrong; a line of best fit is one straight line. 1 2 3 4 5 6 7 8 4 8 12 16 20 x y joined dots: wrong
Joining the dots is not a line of best fit — draw one straight line.

Every line of best fit is written in gradient–intercept form:

\[y = mx + c\]
y=mx+c

Find the gradient from two points on the line:

\[m = \dfrac{\text{rise}}{\text{run}} = \dfrac{\text{change in } y}{\text{change in } x} = \dfrac{y_2 - y_1}{x_2 - x_1}\]
m=(y2-y1)/(x2-x1)
In context. \(m\) is the change in \(y\) for each extra \(1\) unit of \(x\); \(c\) is the starting value when \(x=0\).

How to fit a line of best fit and find its equation

  1. Draw one straight line by eye that follows the trend, with about as many points above as below.
  2. Read the \(y\)-intercept \(c\) where the line crosses the vertical axis.
  3. Choose two points on the line and find \(m=\dfrac{\text{rise}}{\text{run}}\).
  4. Write \(y=mx+c\) using the letters of the problem, and check with a point on the line.
Example 1 — Read c and m, write the equation
The red line of best fit crosses the \(y\)-axis at \(5\) and passes through \((6,23)\). Find its gradient and its equation.
Solution

Read \(c\) at the \(y\)-axis, then use two points on the line for \(m\).

Example 1Line of best fit y = 3x + 5 through (0,5) and (6,23). 1 2 3 4 5 6 7 8 5 10 15 20 25 30 x y (6, 23)
\(c\)\(=\)\(5\)
\(m\)\(=\)\(\dfrac{\text{rise}}{\text{run}} = \dfrac{23-5}{6-0} = \dfrac{18}{6} = 3\)
\(\text{check: } 3(6)+5\)\(=\)\(23\ \checkmark\)
\(\therefore\ y\)\(=\)\(3x+5\)
m=18/6=3;y=3x+5

\(y=3x+5\).

Example 2 — A falling line
A phone’s battery level \(B\) (%) is recorded against the hours of use \(h\). The red line of best fit passes through \((0,100)\) and \((10,40)\). (i) Find the gradient. (ii) Write the equation. (iii) What does the gradient tell us?
Solution

A falling line has a negative gradient — keep the minus sign.

Example 2Falling line of best fit B = -6h + 100. 2 4 6 8 10 12 20 40 60 80 100 Hours h Battery B (%)
\(\text{(i) } m\)\(=\)\(\dfrac{40-100}{10-0} = \dfrac{-60}{10} = -6\)
\(\text{(ii) } c=100\)\(\Rightarrow\)\(B=-6h+100\)
\(\text{(iii) negative}\)\(\Rightarrow\)\(\text{falls about } 6\% \text{ per hour}\)
m=-60/10=-6;B=-6h+100

(i) \(-6\). (ii) \(B=-6h+100\). (iii) The battery drops about 6% each hour.

Example 3 — Gradient and intercept in context
A trailer-hire business finds the line of best fit \(C=18h+35\), where \(C\) is the charge (\(\$\)) and \(h\) is the number of hours hired. (i) What does the gradient \(18\) tell us? (ii) What does the \(C\)-intercept \(35\) represent?
Solution

The gradient is the change per hour; the intercept is the value when \(h=0\).

\(\text{(i) } m=18\)\(\Rightarrow\)\(+\$18 \text{ for each extra hour}\)
\(\text{(ii) at } h=0:\ C\)\(=\)\(18(0)+35 = 35\)
C=18(0)+35=35

(i) About \(\$18\) more per hour. (ii) A fixed \(\$35\) fee before any hours.

Example 4 — From the graph to the model
A kiosk records the daily maximum temperature \(t\) (\(^\circ\)C) and the number of ice-blocks \(N\) sold. The red line of best fit passes through \((0,10)\) and \((30,100)\). (i) Write down the \(N\)-intercept. (ii) Find the gradient. (iii) Write the equation in the form \(N=mt+c\).
Solution

Use the letters of the problem in place of \(x\) and \(y\).

Example 4Line of best fit N = 3t + 10 through (0,10) and (30,100). 5 10 15 20 25 30 35 20 40 60 80 100 120 Temperature t (°C) Ice-blocks N
\(\text{(i) } c\)\(=\)\(10\)
\(\text{(ii) } m\)\(=\)\(\dfrac{100-10}{30-0} = \dfrac{90}{30} = 3\)
\(\text{(iii) } N\)\(=\)\(3t+10\)
m=90/30=3;N=3t+10

(i) \(10\). (ii) \(3\). (iii) \(N=3t+10\).

Common pitfalls

One straight line only. Joining the dots or drawing a curve is not a line of best fit — it is one straight line that balances the points.
Use points on the line. Find the gradient from two points on the line (not two data dots), and divide the rise by the run, not the other way round.
Keep the minus sign. A line that falls has a negative gradient, e.g. \(y=-4x+40\).

Frequently asked questions

How do you draw a line of best fit?

Draw one straight line by eye that follows the trend of the points, with roughly as many points above the line as below it. It does not have to pass through any of the points.

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

Read the y-intercept c where the line crosses the vertical axis. Find the gradient m as rise divided by run, using two points on the line. Then write y = mx + c.

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

Choose two points that lie on the line, not data dots. The gradient is the change in y divided by the change in x, which is rise over run.

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

The gradient is how much y changes for each extra 1 unit of x. For example, in C = 18h + 35 the charge goes up by about 18 dollars for each extra hour.

Can a line of best fit have a negative gradient?

Yes. If the points fall from left to right, the line slopes down and the gradient is negative. Keep the minus sign, for example B = -6h + 100.