Step by step
The question
Question: find the line of best fit for (1, 5), (2, 8), (3, 8), (4, 11), (5, 13).
Then predict y when x is 7.
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: 15 divided by 5 is 3.
The mean of the y numbers: 45 divided by 5 is 9.
The line of best fit always goes through the mean point, (3, 9).
2 Make the table
A table with the points.
Each x minus the mean x, 3.
Each y minus the mean y, 9.
For the first point: 1 minus 3 is −2, and 5 minus 9 is −4.
The product: the two distances multiplied.
−2 times −4 is 8.
And the x distance squared.
−2 squared is 4.
We add the last two columns: 19 and 10.
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.
19/10 is 1.9.
4 Find b
The line goes through the mean point.
So b is the mean y, minus m times the mean x.
1.9 times 3 is 5.7.
9 minus 5.7 is 3.3.
So the line of best fit is y = 1.9x + 3.3.
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.9x + 3.3: it passes close to all the points.
6 Predict
To predict, we put x = 7 into the line.
1.9 times 7 is 13.3.
Plus 3.3 is 16.6.
On the graph: at x = 7, the line is at 16.6.
7 Check
Let's check: the mean point must be on the line.
1.9 times 3 plus 3.3 is 9.
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.