Steply

Line of best fit (1, 12) (2, 13) (3, 16) (4, 17) (5, 14), predict x…

Step by step, with the reason for every step · Line of best fit · Statistics

Step by step

The question

Question: find the line of best fit for (1, 12), (2, 13), (3, 16), (4, 17), (5, 14).

Then predict y when x is 8.

(1, 12) (2, 13) (3, 16) (4, 17) (5, 14)

The line of best fit is the straight line that comes closest to all the points.

best fit: the line closest to all the points

1 Find the means

The mean of the x numbers: 15 divided by 5 is 3.

mean x = 1 + 2 + 3 + 4 + 55 = 155 = 3

The mean of the y numbers: 72 divided by 5 is 14.4.

mean y = 12 + 13 + 16 + 17 + 145 = 725 = 14.4

The line of best fit always goes through the mean point, (3, 14.4).

the line goes through (3, 14.4)

2 Make the table

A table with the points.

Each x minus the mean x, 3.

Each y minus the mean y, 14.4.

For the first point: 1 minus 3 is −2, and 12 minus 14.4 is −2.4.

The product: the two distances multiplied.

−2 times −2.4 is 4.8.

And the x distance squared.

−2 squared is 4.

We add the last two columns: 8 and 10.

3 Find the slope

The slope is the total of the products, over the total of the squares.

m = total of productstotal of squares

Careful!

The bottom uses only the x distances, squared.

Not the y distances.

Careful: the bottom is the x distances squared

8/10 is 0.8.

m = 810 = 0.8

4 Find b

The line goes through the mean point.

So b is the mean y, minus m times the mean x.

b = mean y − m × mean x

0.8 times 3 is 2.4.

14.4 minus 2.4 is 12.

b = 14.4 − 0.8 × 3 = 14.4 − 2.4 = 12

So the line of best fit is y = 0.8x + 12.

= y = 0.8x + 12

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 = 0.8x + 12: it passes close to all the points.

6 Predict

To predict, we put x = 8 into the line.

y = 0.8 × 8 + 12

0.8 times 8 is 6.4.

Plus 12 is 18.4.

y = 18.4

On the graph: at x = 8, the line is at 18.4.

7 Check

Let's check: the mean point must be on the line.

0.8 times 3 plus 12 is 14.4.

That is the mean y.

So it is right!

0.8 × 3 + 12 = 14.4

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.

Answer
= y = 0.8x + 12

Your turn

Try this one yourself, then check:

Best-fit line: (1, 13) (2, 13) (3, 16) (4, 17) (5, 13); predict x = 8
Show the answer
y = 0.4x + 13.2; x = 8: y = 16.4

More from Line of best fit

The whole lesson: Line of best fit →