Steply

Line of best fit (10, 50) (20, 45) (30, 42) (40, 30) (50, 28)…

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 (10, 50), (20, 45), (30, 42), (40, 30), (50, 28).

Then predict y when x is 60.

(10, 50) (20, 45) (30, 42) (40, 30) (50, 28)

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

mean x = 10 + 20 + 30 + 40 + 505 = 1505 = 30

The mean of the y numbers: 195 divided by 5 is 39.

mean y = 50 + 45 + 42 + 30 + 285 = 1955 = 39

The line of best fit always goes through the mean point, (30, 39).

the line goes through (30, 39)

2 Make the table

A table with the points.

Each x minus the mean x, 30.

Each y minus the mean y, 39.

For the first point: 10 minus 30 is −20, and 50 minus 39 is 11.

The product: the two distances multiplied.

−20 times 11 is −220.

And the x distance squared.

−20 squared is 400.

We add the last two columns: −590 and 1000.

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

−590/1000 is −0.59.

m = −5901000 = −0.59

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.59 times 30 is −17.7.

39 minus −17.7 is 56.7.

b = 39 − −0.59 × 30 = 39 − (−17.7) = 56.7

So the line of best fit is y = −0.59x + 56.7.

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

6 Predict

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

y = −0.59 × 60 + 56.7

−0.59 times 60 is −35.4.

Plus 56.7 is 21.3.

y = 21.3

On the graph: at x = 60, the line is at 21.3.

7 Check

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

−0.59 times 30 plus 56.7 is 39.

That is the mean y.

So it is right!

−0.59 × 30 + 56.7 = 39

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.59x + 56.7

Your turn

Try this one yourself, then check:

Best-fit line: (10, 49) (20, 45) (30, 41) (40, 30) (50, 28); predict x = 60
Show the answer
y = −0.57x + 55.7; x = 60: y = 21.5

More from Line of best fit

The whole lesson: Line of best fit →