← Back to course

Least-Squares Regression

You’ll be able to

The least-squares line

The least-squares regression line (LSRL) is the line that makes the sum of the squared vertical distances (residuals) from the points as small as possible. We write it y-hat = a + bx, where y-hat is the predicted response. It always passes through the point (x-bar, y-bar), the "center of mass" of the data.

Interpreting slope and intercept in context

The slope b is the predicted change in y for each one-unit increase in x — always phrased as "predicted" or "on average," never as a certainty. The y-intercept a is the predicted y when x = 0; it is only meaningful if x = 0 is realistic for the data. On the AP exam, slope and intercept interpretations earn credit only when stated in context with units.

Regression line and slope
y-hat = a + bx · b = r · (s_y / s_x) · a = y-bar − b·x-bar
The slope equals r times the ratio of the standard deviations. The line passes through (x-bar, y-bar), which is how the intercept formula is derived.
Coefficient of determination
r² = (fraction of variation in y explained by the linear model on x)
r² ranges from 0 to 1. If r² = 0.64, then 64% of the variation in the response is accounted for by the linear relationship with x. Square r to get it.
Worked example

For predicting exam score from hours studied, the LSRL is score-hat = 52 + 6·(hours). Interpret the slope, and predict the score for a student who studies 5 hours.

  1. 1.The slope is 6, attached to hours studied, so for each additional hour studied the predicted exam score increases by 6 points.
  2. 2.To predict, substitute hours = 5: score-hat = 52 + 6(5).
  3. 3.score-hat = 52 + 30 = 82.
Answer: Slope interpretation: for each additional hour studied, the predicted exam score increases by about 6 points. Prediction: a student who studies 5 hours is predicted to score 52 + 6(5) = 82 points.
Checkpoint

A regression of a plant’s height (cm) on days since planting gives height-hat = 4 + 1.5·(days). Which is the correct interpretation of the slope?

On the exam

Slope interpretations need three parts: the words "predicted" or "on average," the units of y, and the units of x. "For each additional hour, the predicted score increases by 6 points" scores; "the score goes up 6" does not.

Checkpoint

A regression predicting monthly heating cost from outdoor temperature has r² = 0.81. What does this mean?

Answer the 2 checkpoints as you read.

Sign in to save your progress