Steply

Line of best fit (1, 14) (2, 13) (3, 16) (4, 20) (5, 21), 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, 14), (2, 13), (3, 16), (4, 20), (5, 21).

Then predict y when x is 7.

(1, 14) (2, 13) (3, 16) (4, 20) (5, 21)

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: 84 divided by 5 is 16.8.

mean y = 14 + 13 + 16 + 20 + 215 = 845 = 16.8

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

the line goes through (3, 16.8)

2 Make the table

A table with the points.

Each x minus the mean x, 3.

Each y minus the mean y, 16.8.

For the first point: 1 minus 3 is −2, and 14 minus 16.8 is −2.8.

The product: the two distances multiplied.

−2 times −2.8 is 5.6.

And the x distance squared.

−2 squared is 4.

We add the last two columns: 21 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

21/10 is 2.1.

m = 2110 = 2.1

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

2.1 times 3 is 6.3.

16.8 minus 6.3 is 10.5.

b = 16.8 − 2.1 × 3 = 16.8 − 6.3 = 10.5

So the line of best fit is y = 2.1x + 10.5.

= y = 2.1x + 10.5

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

6 Predict

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

y = 2.1 × 7 + 10.5

2.1 times 7 is 14.7.

Plus 10.5 is 25.2.

y = 25.2

On the graph: at x = 7, the line is at 25.2.

7 Check

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

2.1 times 3 plus 10.5 is 16.8.

That is the mean y.

So it is right!

2.1 × 3 + 10.5 = 16.8

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 = 2.1x + 10.5

Your turn

Try this one yourself, then check:

Best-fit line: (1, 13) (2, 15) (3, 17) (4, 21) (5, 20); predict x = 7
Show the answer
y = 2x + 11.2; x = 7: y = 25.2

More from Line of best fit

The whole lesson: Line of best fit →