Steply

Line of best fit (1, 5) (2, 7) (3, 1) (4, 0) (5, 0)

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, 5), (2, 7), (3, 1), (4, 0), (5, 0).

(1, 5) (2, 7) (3, 1) (4, 0) (5, 0)

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

mean y = 5 + 7 + 1 + 0 + 05 = 135 = 2.6

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

the line goes through (3, 2.6)

2 Make the table

A table with the points.

Each x minus the mean x, 3.

Each y minus the mean y, 2.6.

For the first point: 1 minus 3 is −2, and 5 minus 2.6 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: −17 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

−17/10 is −1.7.

m = −1710 = −1.7

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.7 times 3 is −5.1.

2.6 minus −5.1 is 7.7.

b = 2.6 − −1.7 × 3 = 2.6 − (−5.1) = 7.7

So the line of best fit is y = −1.7x + 7.7.

= y = −1.7x + 7.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.7x + 7.7: it passes close to all the points.

6 Check

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

−1.7 times 3 plus 7.7 is 2.6.

That is the mean y.

So it is right!

−1.7 × 3 + 7.7 = 2.6

Let's look back.

First: find the means.

Then: make the table.

Then: find the slope.

Then: find b.

Then: draw the line.

Last: check.

Answer
= y = −1.7x + 7.7

Your turn

Try this one yourself, then check:

Best-fit line: (1, 3) (2, 5) (3, 3) (4, 0) (5, 0)
Show the answer
y = −1.1x + 5.5

More from Line of best fit

The whole lesson: Line of best fit →