Skip to content

Least-squares regression: slope, intercept and r-squared

Calculate a least-squares line and interpret its slope, intercept, R-sq and S in context.

It opens on

Many lines could cross the car data. What makes one the best?

Why it matters

AP Statistics asks you to turn regression calculations and computer output into defensible interpretations.

Good to know first

  • Linear regression models and residuals: ŷ = a + bx predicts, and residual = actual − predicted. Also correlation r, means and standard deviations

Step by step

  1. Finding the line

    Explain least squares and calculate a line from summary statistics.

    Car b = −0.85(5.1/2.4) = −1.80625 ≈ −1.81 thousand dollars/year.

    A common mix-up

    Swapping age and price preserves the regression line.

    In fact: Least squares minimizes vertical residuals of whichever variable is the response.

  2. Using the coefficients

    Interpret slope and intercept, and calculate a predicted response.

    Each additional car year predicts about $1,810 less in price; same-age cars can sell for different amounts.

    A common mix-up

    Every car loses exactly $1,810 per year.

    In fact: The slope describes predicted prices, not individual cars.

  3. Reading the output

    Read coefficient rows and distinguish R-sq from S.

    Car output Coef Constant 25.65, age −1.815 gives ŷ = 25.65 − 1.815x.

    A common mix-up

    R-sq is the percentage of exact predictions.

    In fact: It is a proportion of response variation explained.

Try it

Two five-year-old cars cost $14,000 and $19,200; each has predicted price $16,600. Find their residuals.Answer

−$2,600 and +$2,600 (hint: actual minus predicted).

Predict car price at age seven; is the intercept supported by observed new cars?Answer

About $12,930; unknown (hint: substitute seven, then check whether an age range was supplied).

Car R-sq is 71.7% and its slope is negative. Estimate r.Answer

About −0.847 (hint: take √0.717, then apply the sign).

Write the sleep intercept and line.Answer

a = 74 − 4.5(3.0) = 60.5; ŷ = 60.5 + 4.5x.

Write the sleep prediction at four hours.Answer

ŷ(4) = 60.5 + 4.5(4) = 78.5 points.

Least-squares regression: slope, intercept and r-squared

30 minutes every month. No card.