Skip to main content

Unit 5 · Topic 5.5

5.5 Least-Squares Regression

The least-squares regression line (LSRL) is the line that makes the sum of squared residuals as small as possible. You'll get its slope, intercept and r from technology, and interpret the slope, the y-intercept and r² in context.

Key terms

  • least-squares regression line (LSRL)
  • sum of squared residuals
  • interpreting the slope
  • interpreting the y-intercept
  • coefficient of determination (r²)

What makes it "least squares"

Among all possible lines, the LSRL is the one that makes Σ(y − ŷ)², the sum of the squared residuals, as small as possible. Squaring makes every residual positive and penalizes big misses more than small ones.

For the hours-and-scores data, the LSRL ŷ = 58.55 + 3.83x has a sum of squared residuals of about 38.1. Any other line does worse; for example, ŷ = 60 + 3.6x gives about 42.9.

The LSRL always passes through the point of means (x̄, ȳ). Here x̄ = 4.3 hours and ȳ = 75.0 points, and 58.55 + 3.83(4.3) ≈ 75.0.

Getting the line

Use technology (LinReg(a+bx) on a calculator, or a regression in Desmos) with the data lists. It gives the slope b, the intercept a, r and r². The formula sheet only gives ŷ = a + bx; you aren't expected to compute b and a by hand.

Report the equation in context: predicted exam score = 58.55 + 3.83(hours studied). Here r ≈ 0.974 and r² ≈ 0.949.

Interpreting the slope

The slope is the predicted change in y for each one-unit increase in x. "For each additional hour studied, the predicted exam score increases by about 3.83 points."

Use the word predicted (or "on average"). The slope describes the line, not a guarantee for every student. A negative slope means the predicted y decreases as x increases.

Interpreting the y-intercept

The y-intercept is the predicted y when x = 0. "The predicted exam score for a student who studies 0 hours is about 58.55 points."

Sometimes the intercept has no sensible meaning. If x = 0 is far outside the data, interpreting it is extrapolation. If it gives an impossible value (like a negative weight in 5.3's height example), say it has no reasonable interpretation in context.

Interpreting r²

r², the coefficient of determination, is the proportion of the variation in y that is explained by the linear relationship with x. "About 94.9% of the variation in exam scores is explained by the linear relationship between exam score and hours studied." The remaining 5.1% comes from other factors and chance.

r² is between 0 and 1 and has no sign. To get r from r², take the square root and attach the sign of the slope.

You won't be tested on influential points, high-leverage points, the standard deviation of the residuals, the formula b = r·sy/sx or transforming data to straighten a curve. Those were removed from the course.

Worked examples

Try each one yourself first, then open the solution.

  1. Example 1Calculator allowed

    Find and interpret the LSRL

    Use the hours-and-scores data from 5.1. Find the least-squares regression line, then interpret the slope, the y-intercept and r².

    Show the solution
    1. Step 1: Technology: a ≈ 58.55, b ≈ 3.83, r ≈ 0.974, r² ≈ 0.949.
    2. Step 2: Equation: predicted score = 58.55 + 3.83(hours).
    3. Step 3: Slope: for each additional hour studied, the predicted exam score increases by about 3.83 points.
    4. Step 4: Intercept: a student who studies 0 hours has a predicted score of about 58.55 points. 0 is just below the data's range (1 to 8 hours), so treat this with some caution.
    5. Step 5: r²: about 94.9% of the variation in exam score is explained by the linear relationship with hours studied.

    Answer: ŷ = 58.55 + 3.83x. Slope: +3.83 predicted points per extra hour. Intercept: 58.55 predicted points at 0 hours (slight extrapolation). r²: 94.9% of the variation in scores is explained by the linear model.

  2. Example 2Calculator allowed

    From r² back to r

    A regression of a used car's price on its age (years) has r² = 0.64 and slope −1,150 dollars per year. Find r and interpret the slope.

    Show the solution
    1. Step 1: √0.64 = 0.8. The slope is negative, so r = −0.8.
    2. Step 2: Slope: for each additional year of age, the predicted price decreases by about 1,150 dollars.

    Answer: r = −0.8. The predicted price drops by about 1,150 dollars for each additional year of age.

  3. Example 3Calculator allowed

    Trap: deterministic language

    A student interprets the slope 3.83 as: "Every extra hour of studying raises a student's score by 3.83 points." What's wrong?

    Show the solution
    1. Step 1: The slope describes the predicted (average) change, not what happens to each student.
    2. Step 2: The data are observational, so the slope doesn't show that studying causes the increase, even if that's plausible.
    3. Step 3: Fix: "For each additional hour studied, the predicted exam score increases by about 3.83 points."

    Answer: It should say the predicted score increases by about 3.83 points per extra hour; it's not a guaranteed or causal effect for each student.

Common mistakes

  • Interpreting the slope without "predicted" or "on average."
  • Interpreting the y-intercept when x = 0 is meaningless or far outside the data, without saying so.
  • Interpreting r² as "the percent of points on the line" or as the correlation.
  • Forgetting that r takes the sign of the slope when found from r².

On the exam

  • Templates readers look for: slope as the predicted change in y per one-unit increase in x; intercept as the predicted y when x = 0; r² as the percent of variation in y explained by the linear relationship with x. Always in context.
  • Expect computer output or calculator results instead of raw data. Identify a, b, r and r² from the output before answering.

Connected topics

Videos

  • AP Stats 5.3 - Least-Squares Regression

    Skew The ScriptWatch on YouTube (opens in a new tab)

  • Least Squares Regression - AP Statistics Unit 2 Summary Topic 2.8

    Michael Porinchak - AP Statistics & AP PrecalculusWatch on YouTube (opens in a new tab)

  • The Main Ideas of Fitting a Line to Data (The Main Ideas of Least Squares and Linear Regression.)

    StatQuest with Josh StarmerWatch on YouTube (opens in a new tab)

  • Interpreting slope of regression line | AP Statistics | Khan Academy

    Khan AcademyWatch on YouTube (opens in a new tab)

  • Regression and R-Squared (2.2)

    Simple Learning ProWatch on YouTube (opens in a new tab)

  • Simple Linear Regression: The Least Squares Regression Line

    jbstatisticsWatch on YouTube (opens in a new tab)

Check yourself

4 questions on 5.5 Least-Squares Regression. Pick an answer to see if you got it, and why.

Question 1 of 4Calculator allowed

For a set of data, x̄ = 10 and ȳ = 47, and the slope of the least-squares regression line is 3.2. What is the y-intercept?

Question 2 of 4Calculator allowed

What makes the least-squares regression line different from any other line drawn through a scatterplot?

Question 3 of 4Calculator allowed

A least-squares line for predicting the number of calories burned (y) from minutes of jogging (x) is ŷ = 18 + 9.4x. Which is the correct interpretation of the slope?

Question 4 of 4Calculator allowed

A least-squares line predicts the weight (in pounds) of adult male bears from their chest girth (in inches): ŷ = −245 + 11.5x. The bears in the data had chest girths from 30 to 55 inches. What should you say about the y-intercept?

0 of 4 answered