AP Statistics · Unit 5 · Topic 5.5

Least-Squares Regression Study Lab

Many lines could fit a scatterplot. The least-squares regression line is the one that makes the total of the squared residuals as small as possible. Drag points, try to beat it with your own line, compute the slope and intercept from summary statistics, and read the values that matter in computer output.

1. Find the line with the smallest squared residuals

The least-squares regression line is the one line that makes the sum of the squared residuals as small as possible. Drag points, compare your own line, and see every square.

b = r · sy ÷ sₓ a = ȳ − b·x̄ ŷ = a + bx passes through (x̄, ȳ)
Data sets

drag any point

Least-squares lineMy linePoint of means (x̄, ȳ)
Squares to show
My line
Turns my line around the point of means.
Correlation r
r²
s
(x̄, ȳ)
Sum of squared residuals, least squares
Sum of squared residuals, my line
My line
n

Show your work

Computer output

Read Coef for the intercept (Constant row) and slope (variable row), plus S and R-Sq. The gray SE Coef, T, and P columns are used for inference about the slope, which is not part of the revised AP Statistics course.

2. Key ideas

Least squares

Smallest sum of squared residuals

Of all possible lines, the least-squares regression line (LSRL) makes Σ(y − ŷ)² as small as possible. Squaring keeps positive and negative residuals from canceling and penalizes big misses.

Formulas

Slope and intercept from summaries

b = r · sy ÷ sₓ and a = ȳ − b·x̄. These are on the AP formula sheet. The slope has the same sign as r.

Point of means

The line passes through (x̄, ȳ)

Substituting x̄ into the LSRL always gives ȳ. Moving one point changes x̄ and ȳ, so the whole line shifts.

r²

Coefficient of determination

r² is the fraction of the variation in y that is accounted for by the linear relationship with x. It is between 0 and 1. Interpret it as a percent, in context.

s

Typical prediction error

s, the standard deviation of the residuals, gives the typical distance between actual y-values and the line's predictions, in y's units.

Direction matters

Regressing y on x ≠ x on y

The LSRL minimizes vertical distances, so it depends on which variable is the response. Predicting x from y uses a different line, even though r is the same.

3. Reading regression output

Where to find each value in typical computer output, and how to interpret it.

ValueWhere it appearsInterpretation template
Intercept aCoef column, Constant rowWhen x = 0, the predicted y is a (only if x = 0 makes sense).
Slope bCoef column, row named for xFor each 1-unit increase in x, the predicted y changes by b.
r²R-Sq (often as a percent)About __% of the variation in y is accounted for by the linear relationship with x.
sSActual y-values typically differ from predicted values by about s.
rNot shown directly: r = ±√r², with the sign of the slopeStrength and direction of the linear association.
SE Coef, T, POther columnsUsed for inference about the slope, which is not in the revised course.

4. On the FRQ

How to earn the points

  • When given summary statistics, show both formulas with numbers: "b = 0.87(6.2 ÷ 3.1) = 1.74; a = 70 − 1.74(5) = 61.3."
  • Write the final equation with ŷ or "predicted" and the variable names.
  • Read the slope and intercept from the Coef column of computer output; do not use the SE Coef or T values.
  • Interpret r² in context: "About 82% of the variation in exam scores is accounted for by the linear relationship with hours studied."
  • To find r from output, take √r² and give it the sign of the slope.

Common mistakes

  • Calling the LSRL the line that "goes through the most points." It minimizes the sum of squared residuals.
  • Using b = r · sₓ ÷ sy (flipped). The response's spread goes on top.
  • Interpreting r² as "the percent of points on the line" or "the percent of x explained by y."
  • Taking √r² and forgetting the sign: if the slope is negative, r is negative.
  • Assuming the line for predicting x from y is the same as the line for predicting y from x.

5. Practice questions

AP-style multiple choice. Pick an answer to see the explanation.

0 / 0 correct

6. Key terms

The vocabulary for topic 5.5. Read the list, flip through flashcards, or quiz yourself. For every term in the unit, see the Unit 5 terminology guide.