Skip to content
Home › AP Statistics Math › AP Statistics Lessons › Regression Analysis: Lines, Residuals and r: AP Statistics Math Lesson

Regression Analysis: Lines, Residuals and r: AP Statistics Math Lesson

Last updated: October 22, 2026 · Written by the Math Made Easy math teachers

AP Statistics Math Lessons – Mathbot, the Math Made Easy robot coach, with free printable lessons for AP Statistics

Looking for regression AP statistics? Then this AP Statistics lesson on Regression Analysis: Lines, Residuals and r explains each idea step by step, with worked examples.

Quick answer: Regression describes the linear relationship between an explanatory and a response variable. Correlation r measures the strength and direction of a linear pattern, the least-squares line ŷ = a + bx predicts the response, r² gives the percent of variation explained, and residual plots check whether a line is appropriate.

Standards: AP Statistics Unit 5 (2026-27) · Level: Grade 12 AP Statistics

How do you describe a scatterplot?

A scatterplot shows two quantitative variables measured on the same individuals. The explanatory variable goes on the x-axis and the response variable on the y-axis. Describe the direction (positive or negative), form (linear or curved), strength, and unusual features such as outliers.

30405060708090Cups sold60708090100Temperature (°F)
Smoothie stand: temperature and cups sold.

The smoothie stand data show a strong, positive, linear association between temperature and cups sold, with no outliers.

What does the correlation r measure?

Correlation

r = 1n − 1 ∑ xi − x̄sx · yi − ȳsy

−1 ≤ r ≤ 1. The sign gives the direction and the size gives the strength of a linear pattern. Changing units does not change r, and r is not resistant to outliers.

Here r = 0.9933. Correlation does not show causation: a lurking variable can drive both variables.

How do you find and use the least-squares line?

Least-squares regression line

ŷ = a + bx,   b = r sysx,   a = ȳ − bx̄

The line always passes through (x̄, ȳ). Residual = y − ŷ (actual minus predicted).

Worked example

For the smoothie data, x̄ = 78.44, sx = 10.561, ȳ = 59.89, sy = 15.592. Then b = 0.9933 × 15.592/10.561 = 1.467 and a = 59.89 − 1.467(78.44) = −55.15. The line is ŷ = −55.15 + 1.47x. Slope: each additional degree is associated with about 1.47 more cups sold, on average. Intercept: at 0°F the model predicts −55.1 cups, which is outside the data and not meaningful. For 85°F, ŷ = 69.5 cups.

How do you judge whether the line fits?

The coefficient of determination r2 = 0.9866 says that about 98.7% of the variation in cups sold is explained by the linear relationship with temperature. A residual plot should show random scatter around 0; a curved pattern means a line is not appropriate.

-4-2024Residual60708090100Temperature (°F)
Residual plot: no pattern.

An influential point is one whose removal changes the line noticeably, typically a point far from the others in the x direction. Extrapolation, predicting outside the range of the data, is unreliable.

30405060708090Cups sold60708090100110Temperature (°F)
One high-leverage point changes the line (solid: with it; dashed: without).
Mathbot’s tip

Interpret slope with the words on average, and name both variables with units. Never say that x causes y unless the data come from a randomized experiment.

Key points to remember

  • Describe a scatterplot by direction, form, strength and unusual features.
  • Slope b = r·s_y/s_x; the line passes through (x̄, ȳ).
  • Residual = actual y − predicted ŷ.
  • r² is the proportion of variation in y explained by the line.
  • Extrapolation and influential points can make a model misleading.

Regression Analysis: Lines, Residuals and r: frequently asked questions

What does the slope of a regression line mean?

The slope is the predicted change in the response for each one-unit increase in the explanatory variable. Use the words predicted or on average, and include units, for example: each extra degree is associated with about 1.4 more cups sold.

What does r² tell you?

It is the proportion of the variation in the response that is accounted for by the linear relationship with the explanatory variable. An r² of 0.96 means about 96% of the variation in y is explained by the line; the rest is unexplained.

What is a residual and what does a residual plot show?

A residual is the actual y minus the predicted y. A residual plot graphs residuals against x or ŷ. Random scatter around 0 means a line is appropriate; a curve or a fan shape shows the linear model is not a good fit.

What is the difference between an outlier and an influential point?

An outlier has an unusual y value given its x, giving a large residual. An influential point is one whose removal would substantially change the slope or intercept. Points far away in the x direction are often influential even with a small residual.

Why is extrapolation risky?

The linear pattern is only known for the range of x-values in the data. Beyond that range the relationship may change, so predictions can be far from the truth. Interpolating within the range is much safer.

Math textbooks to download in PDF, from grade 6 to AP Calculus