Line of Best Fit
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.
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\).
Every line of best fit is written in gradient–intercept form:
Find the gradient from two points on the line:
How to fit a line of best fit and find its equation
- Draw one straight line by eye that follows the trend, with about as many points above as below.
- Read the \(y\)-intercept \(c\) where the line crosses the vertical axis.
- Choose two points on the line and find \(m=\dfrac{\text{rise}}{\text{run}}\).
- Write \(y=mx+c\) using the letters of the problem, and check with a point on the line.
Read \(c\) at the \(y\)-axis, then use two points on the line for \(m\).
| \(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\) |
\(y=3x+5\).
A falling line has a negative gradient — keep the minus sign.
| \(\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}\) |
(i) \(-6\). (ii) \(B=-6h+100\). (iii) The battery drops about 6% each hour.
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\) |
(i) About \(\$18\) more per hour. (ii) A fixed \(\$35\) fee before any hours.
Use the letters of the problem in place of \(x\) and \(y\).
| \(\text{(i) } c\) | \(=\) | \(10\) |
| \(\text{(ii) } m\) | \(=\) | \(\dfrac{100-10}{30-0} = \dfrac{90}{30} = 3\) |
| \(\text{(iii) } N\) | \(=\) | \(3t+10\) |
(i) \(10\). (ii) \(3\). (iii) \(N=3t+10\).
Common pitfalls
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.