Skip to content
Now Accepting Applications for 2027-2028Apply
ITMagicITMagicAcademy
AP resources
APMathematicsAP Statistics

Linear Regression and Residuals

AP Statistics, Unit 2 and Unit 9. The least squares line from summary statistics, residuals and residual plots, r squared, interpreting slope in context, and the traps graders look for.

Regression appears twice in AP Statistics: in Unit 2, Exploring Two-Variable Data, as a description, and in Unit 9, Inference for Quantitative Data: Slopes, as a model you test. Almost every question comes back to the same line and the same four words: slope, intercept, residual, r squared.

The least squares line

ŷ = a + bx

  • Slope: b = r × (s_y / s_x)
  • Intercept: the line always passes through (x̄, ȳ), so a = ȳ − b x̄.

The hat on ŷ matters. It says the value is a prediction, not an observed y. Graders take points for a missing hat or for writing y alone.

Residuals

residual = y − ŷ (actual minus predicted)

A positive residual means the point lies above the line: the model underestimated. A residual plot shows residuals against x.

  • Random scatter around zero: a linear model is appropriate.
  • A curved pattern: the relationship is not linear, try a transformation.
  • A fan shape: the spread changes with x, predictions are less reliable at one end.

r and r squared

  • r measures the direction and strength of a linear relationship, from −1 to 1.
  • r² is the fraction of the variation in y accounted for by the linear model with x.

A strong r does not prove causation and does not prove the relationship is linear. Always look at the scatterplot and the residual plot too.

Worked example

For a set of data, x̄ = 10, ȳ = 50, s_x = 2, s_y = 8 and r = 0.75.

  1. Slope: b = 0.75 × 8/2 = 3.
  2. Intercept: a = 50 − 3 × 10 = 20, so ŷ = 20 + 3x.
  3. Prediction at x = 12: ŷ = 56. If the observed value is 53, the residual is 53 − 56 = −3, so the model overestimated by 3.
  4. r² = 0.5625: about 56% of the variation in y is accounted for by the linear relationship with x.

Interpreting in context

  • Slope: "For each additional hour studied, the predicted score increases by 3 points."
  • Intercept: interpret it only if x = 0 makes sense in the context; otherwise say it has no practical meaning.
  • Extrapolation: predicting far outside the range of the data is unreliable, because the pattern may not continue.
  • Influential points: a point with an extreme x can pull the slope. Check whether removing it changes the line a lot.

The free response approach

Use the variable names from the problem, include the word "predicted" in every interpretation, and justify "linear is appropriate" with the residual plot, not with r alone.

Short Lesson Video

The lesson video for this topic will be added soon.

Mock Exam

The mock exam for this topic will be added soon.

Practice Quiz

Test yourself: instant results and explanations.

  1. 1. For a data set, r = 0.6, s_x = 5 and s_y = 10. What is the slope of the least squares line?

  2. 2. The line is ŷ = 12 + 2.5x. At x = 4 the observed value is 20. What is the residual?

  3. 3. A regression has r² = 0.81. Which interpretation is correct?

  4. 4. A residual plot shows a clear curved pattern. What should you conclude?

  5. 5. The line predicting exam score from hours studied is ŷ = 30 + 4.2x. Which is the correct interpretation of the slope?

Need support with this topic?

In a free 45-minute intro call we assess your level and build a study plan tailored to you.

Free intro call