Steply

Line of best fit

Statistics · 20 problems, easy to harder

▶ Watch the first one solved

How we do it

  1. Find the means
  2. Make the table
  3. Find the slope
  4. Find b
  5. Draw the line
  6. Predict
  7. Check

The steps for Line of best fit (1, 8) (2, 9) (3, 8) (4, 5) (5, 3), predict x = 6. Every solution names its steps, so you always know what comes next.

Worked examples

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

The question

Question: find the line of best fit for (1, 2), (2, 4), (3, 5), (4, 4), (5, 7).

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

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

mean y = 2 + 4 + 5 + 4 + 75 = 225 = 4.4

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

the line goes through (3, 4.4)

2 Make the table

A table with the points.

Each x minus the mean x, 3.

Each y minus the mean y, 4.4.

For the first point: 1 minus 3 is −2, and 2 minus 4.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: 10 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

10/10 is 1.

m = 1010 = 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 times 3 is 3.

4.4 minus 3 is 1.4.

b = 4.4 − 1 × 3 = 4.4 − 3 = 1.4

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

= y = x + 1.4

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

6 Check

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

1 times 3 plus 1.4 is 4.4.

That is the mean y.

So it is right!

1 × 3 + 1.4 = 4.4

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 = x + 1.4

▶ Watch it solved

Line of best fit (1, 8) (2, 9) (3, 8) (4, 5) (5, 3), predict x = 6 Medium

The question

Question: find the line of best fit for (1, 8), (2, 9), (3, 8), (4, 5), (5, 3).

Then predict y when x is 6.

(1, 8) (2, 9) (3, 8) (4, 5) (5, 3)

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

mean y = 8 + 9 + 8 + 5 + 35 = 335 = 6.6

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

the line goes through (3, 6.6)

2 Make the table

A table with the points.

Each x minus the mean x, 3.

Each y minus the mean y, 6.6.

For the first point: 1 minus 3 is −2, and 8 minus 6.6 is 1.4.

The product: the two distances multiplied.

−2 times 1.4 is −2.8.

And the x distance squared.

−2 squared is 4.

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

−14/10 is −1.4.

m = −1410 = −1.4

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

6.6 minus −4.2 is 10.8.

b = 6.6 − −1.4 × 3 = 6.6 − (−4.2) = 10.8

So the line of best fit is y = −1.4x + 10.8.

= y = −1.4x + 10.8

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

6 Predict

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

y = −1.4 × 6 + 10.8

−1.4 times 6 is −8.4.

Plus 10.8 is 2.4.

y = 2.4

On the graph: at x = 6, the line is at 2.4.

7 Check

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

−1.4 times 3 plus 10.8 is 6.6.

That is the mean y.

So it is right!

−1.4 × 3 + 10.8 = 6.6

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.4x + 10.8

▶ Watch it solved

Line of best fit (10, 19) (20, 26) (30, 38) (40, 46) (50, 59)… Harder

The question

Question: find the line of best fit for (10, 19), (20, 26), (30, 38), (40, 46), (50, 59).

Then predict y when x is 60.

(10, 19) (20, 26) (30, 38) (40, 46) (50, 59)

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

mean y = 19 + 26 + 38 + 46 + 595 = 1885 = 37.6

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

the line goes through (30, 37.6)

2 Make the table

A table with the points.

Each x minus the mean x, 30.

Each y minus the mean y, 37.6.

For the first point: 10 minus 30 is −20, and 19 minus 37.6 is −18.6.

The product: the two distances multiplied.

−20 times −18.6 is 372.

And the x distance squared.

−20 squared is 400.

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

1000/1000 is 1.

m = 10001000 = 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 times 30 is 30.

37.6 minus 30 is 7.6.

b = 37.6 − 1 × 30 = 37.6 − 30 = 7.6

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

= y = x + 7.6

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

6 Predict

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

y = 1 × 60 + 7.6

1 times 60 is 60.

Plus 7.6 is 67.6.

y = 67.6

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

7 Check

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

1 times 30 plus 7.6 is 37.6.

That is the mean y.

So it is right!

1 × 30 + 7.6 = 37.6

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 = x + 7.6

▶ Watch it solved

Practice

Try each one, then open the answer. Stuck? Open the problem to watch every step.

Easy

  1. line of best fit (1, 2) (2, 4) (3, 5) (4, 4) (5, 7)
    Answer
    = y = x + 1.4
  2. line of best fit (1, 4) (2, 6) (3, 8) (4, 9) (5, 13)
    Answer
    = y = 2.1x + 1.7
  3. line of best fit (1, 2) (2, 4) (3, 5) (4, 4) (5, 7), predict x = 7
    Answer
    = y = x + 1.4
  4. line of best fit (0, 4) (1, 1) (2, 5) (3, 6) (4, 9), predict x = 6
    Answer
    = y = 1.5x + 2
  5. line of best fit (1, 9) (2, 7) (3, 7) (4, 4) (5, 3)
    Answer
    = y = −1.5x + 10.5
  6. line of best fit (1, 3) (2, 5) (3, 6) (4, 8), predict x = 6
    Answer
    = y = 1.6x + 1.5

Medium

  1. line of best fit (1, 8) (2, 9) (3, 8) (4, 5) (5, 3), predict x = 6
    Answer
    = y = −1.4x + 10.8
  2. line of best fit (2, 6) (4, 12) (6, 14) (8, 14) (10, 17), predict x = 12
    Answer
    = y = 1.2x + 5.4
  3. line of best fit (1, 10) (2, 13) (3, 12) (4, 16)
    Answer
    = y = 1.7x + 8.5
  4. line of best fit (1, 6) (2, 3) (3, 1) (4, 1) (5, 0)
    Answer
    = y = −1.4x + 6.4
  5. line of best fit (1, 3) (3, 6) (5, 10) (7, 10) (9, 12), predict x = 11
    Answer
    = y = 1.1x + 2.7
  6. line of best fit (1, 12) (2, 13) (3, 16) (4, 17) (5, 14), predict x = 8
    Answer
    = y = 0.8x + 12
  7. line of best fit (1, 5) (2, 8) (3, 8) (4, 11) (5, 13), predict x = 7
    Answer
    = y = 1.9x + 3.3
  8. line of best fit (1, 2) (2, 4) (3, 4) (4, 6) (5, 4)
    Answer
    = y = 0.6x + 2.2

Harder

  1. line of best fit (10, 19) (20, 26) (30, 38) (40, 46) (50, 59), predict x = 60
    Answer
    = y = x + 7.6
  2. line of best fit (1, 14) (2, 13) (3, 16) (4, 20) (5, 21), predict x = 7
    Answer
    = y = 2.1x + 10.5
  3. line of best fit (1, 5) (2, 7) (3, 1) (4, 0) (5, 0)
    Answer
    = y = −1.7x + 7.7
  4. line of best fit (1, 8) (2, 7) (3, 6) (4, 9) (5, 10), predict x = 10
    Answer
    = y = 0.6x + 6.2
  5. line of best fit (10, 50) (20, 45) (30, 42) (40, 30) (50, 28), predict x = 60
    Answer
    = y = −0.59x + 56.7
  6. line of best fit (1, 3) (2, 2) (3, 3) (4, 0) (5, 0), predict x = 3
    Answer
    = y = −0.8x + 4