Step by step
The question
Question: find the line of best fit for (2, 6), (4, 12), (6, 14), (8, 14), (10, 17).
Then predict y when x is 12.
The line of best fit is the straight line that comes closest to all the points.
1 Find the means
The mean of the x numbers: 30 divided by 5 is 6.
The mean of the y numbers: 63 divided by 5 is 12.6.
The line of best fit always goes through the mean point, (6, 12.6).
2 Make the table
A table with the points.
Each x minus the mean x, 6.
Each y minus the mean y, 12.6.
For the first point: 2 minus 6 is −4, and 6 minus 12.6 is −6.6.
The product: the two distances multiplied.
−4 times −6.6 is 26.4.
And the x distance squared.
−4 squared is 16.
We add the last two columns: 48 and 40.
3 Find the slope
The slope is the total of the products, over the total of the squares.
Careful!
The bottom uses only the x distances, squared.
Not the y distances.
48/40 is 1.2.
4 Find b
The line goes through the mean point.
So b is the mean y, minus m times the mean x.
1.2 times 6 is 7.2.
12.6 minus 7.2 is 5.4.
So the line of best fit is y = 1.2x + 5.4.
5 Draw the line
Now the points on a graph.
Each point is a dot.
The line goes through the mean point.
The line y = 1.2x + 5.4: it passes close to all the points.
6 Predict
To predict, we put x = 12 into the line.
1.2 times 12 is 14.4.
Plus 5.4 is 19.8.
On the graph: at x = 12, the line is at 19.8.
7 Check
Let's check: the mean point must be on the line.
1.2 times 6 plus 5.4 is 12.6.
That is the mean y.
So it is right!
Let's look back.
First: find the means.
Then: make the table.
Then: find the slope.
Then: find b.
Then: draw the line.
Then: predict.
Last: check.