Steply

Line of best fit (1, 3) (3, 6) (5, 10) (7, 10) (9, 12), predict x = 11

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, 3), (3, 6), (5, 10), (7, 10), (9, 12).

Then predict y when x is 11.

(1, 3) (3, 6) (5, 10) (7, 10) (9, 12)

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

mean x = 1 + 3 + 5 + 7 + 95 = 255 = 5

The mean of the y numbers: 41 divided by 5 is 8.2.

mean y = 3 + 6 + 10 + 10 + 125 = 415 = 8.2

The line of best fit always goes through the mean point, (5, 8.2).

the line goes through (5, 8.2)

2 Make the table

A table with the points.

Each x minus the mean x, 5.

Each y minus the mean y, 8.2.

For the first point: 1 minus 5 is −4, and 3 minus 8.2 is −5.2.

The product: the two distances multiplied.

−4 times −5.2 is 20.8.

And the x distance squared.

−4 squared is 16.

We add the last two columns: 44 and 40.

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

44/40 is 1.1.

m = 4440 = 1.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

1.1 times 5 is 5.5.

8.2 minus 5.5 is 2.7.

b = 8.2 − 1.1 × 5 = 8.2 − 5.5 = 2.7

So the line of best fit is y = 1.1x + 2.7.

= y = 1.1x + 2.7

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.1x + 2.7: it passes close to all the points.

6 Predict

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

y = 1.1 × 11 + 2.7

1.1 times 11 is 12.1.

Plus 2.7 is 14.8.

y = 14.8

On the graph: at x = 11, the line is at 14.8.

7 Check

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

1.1 times 5 plus 2.7 is 8.2.

That is the mean y.

So it is right!

1.1 × 5 + 2.7 = 8.2

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 = 1.1x + 2.7

Your turn

Try this one yourself, then check:

Best-fit line: (1, 3) (3, 6) (5, 8) (7, 8) (9, 13); predict x = 11
Show the answer
y = 1.1x + 2.1; x = 11: y = 14.2

More from Line of best fit

The whole lesson: Line of best fit →