Steply

(Same five points.) Which is the least-squares regression line?

Step by step, with the reason for every step · AP Statistics Practice Exam 1 · AP Statistics

Step by step

The question

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

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

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

There are four choices.

First we solve it, the normal way.

Then we pick.

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

mean y = 2 + 3 + 5 + 4 + 65 = 205 = 4

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

the line goes through (3, 4)

2 Make the table

A table with the points.

Each x minus the mean x, 3.

Each y minus the mean y, 4.

For the first point: 1 minus 3 is −2, and 2 minus 4 is −2.

The product: the two distances multiplied.

−2 times −2 is 4.

And the x distance squared.

−2 squared is 4.

We add the last two columns: 9 and 10.

3 Find the slope

A line is y = m x + b.

The slope m is how much y goes up when x goes up by 1.

The products show how y moves with x.

The squares show how x moves by itself.

So 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

9/10 is 0.9.

m = 910 = 0.9

4 Find b

b is where the line crosses the y axis.

The line goes through the mean point.

So the mean y is m times the mean x, plus b.

mean y = m × mean x + b

To get b alone, we take m times the mean x away from both sides.

b = mean y − m × mean x

0.9 times 3 is 2.7.

4 minus 2.7 is 1.3.

b = 4 − 0.9 × 3 = 4 − 2.7 = 1.3

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

y = 0.9x + 1.3

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

6 Check

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

0.9 times 3 plus 1.3 is 4.

That is the mean y.

So it is right!

0.9 × 3 + 1.3 = 4

7 Pick the choice

Our answer is y = 0.9x + 1.3.

That is choice A.

A) y = 0.9x + 1.3

8 Why not the others

B is y = x + 1.

Wrong: through the first two points only.

B) y = x + 1 ✗ through the first two points only

C is y = 1.3x + 0.9.

Wrong: swapped the slope and the intercept.

C) y = 1.3x + 0.9 ✗ swapped the slope and the intercept

D is y = 0.9x.

Wrong: left out the intercept: the line goes through (3, 4).

D) y = 0.9x ✗ left out the intercept: the line goes through (3, 4)

Let's look back.

First: find the means.

Then: make the table.

Then: find the slope.

Then: find b.

Then: draw the line.

Then: check.

Then: pick the choice.

Last: why not the others.

Answer
y = 0.9x + 1.3

Your turn

Try this one yourself, then check your answer:

Best-fit line: (1, 2) (2, 5) (3, 6) (4, 2) (5, 7)
Show the answer
y = 0.7x + 2.3

More from AP Statistics Practice Exam 1

The whole lesson: AP Statistics Practice Exam 1 →