AP-STATS-2.6-2.8

U2.6 Least Squares Regression

Master the AP Statistics least-squares regression line: build ŷ = a + bx, interpret slope and intercept in context, use the r formula, and avoid extrapolation.

What you'll do in this lesson

A voice-first session with the Crimsora tutor on U2.6 Least Squares Regression, then targeted practice and FRQs — with the tutor adapting to where you get stuck.

What this lesson covers

Correlation told you how strongly two quantitative variables move together, but it can't predict. The least-squares regression line (LSRL) does: it gives you an equation that predicts a response value from an explanatory value. In this lesson you'll learn to build the line y^=a+bx\hat{y} = a + bx, translate its slope and intercept into real-world sentences, and use the elegant formula y^=yˉ+rsysx(xxˉ)\hat{y} = \bar{y} + r\frac{s_y}{s_x}(x - \bar{x}) that connects regression back to correlation. You'll also learn the single most-penalized mistake on the exam: extrapolating beyond your data. Getting the interpretation language exactly right is where easy points are won and lost.

What 'Least Squares' Actually Means

A regression line predicts a response variable yy from an explanatory variable xx. We write the prediction as y^\hat{y} ("y-hat") to signal it is a predicted value, not an observed one. The line has the form y^=a+bx\hat{y} = a + bx, where aa is the y-intercept and bb is the slope.

Out of the infinitely many lines you could draw through a scatterplot, the least-squares regression line is the one specific line that makes the sum of the squared residuals as small as possible. A residual is the vertical gap between an actual data point and the line: residual=yy^\text{residual} = y - \hat{y}. We square each residual (so positives and negatives don't cancel) and add them up; the LSRL minimizes that total.

This is why the line is unique and why it always passes through the point (xˉ,yˉ)(\bar{x}, \bar{y}), the mean of both variables. On the AP exam you will rarely minimize anything by hand — technology or given summary statistics produce aa and bb. Your job is to construct the equation, define your variables, and interpret the pieces correctly. A common misconception is thinking the line minimizes perpendicular distance or absolute distance; it specifically minimizes squared vertical distances in the yy direction, which is why the choice of explanatory vs. response variable matters.

Interpreting Slope and Intercept in Context

Interpretation is where AP graders are strict, so use a template every time.

Slope bb: "For each additional one-unit increase in [x in context], the predicted [y in context] increases (or decreases) by bb [units of y] on average." The words "predicted" and "on average" both matter — slope describes a prediction, not a guarantee that every individual changes by exactly bb.

Intercept aa: "When [x in context] is 00, the predicted [y in context] is aa [units]." Always ask whether x=0x = 0 is meaningful; sometimes the intercept is just a mathematical anchor with no realistic interpretation.
ElementSymbolInterpretation template
SlopebbPredicted change in yy per one-unit increase in xx
InterceptaaPredicted yy when x=0x = 0
Predictiony^\hat{y}Estimated response for a given xx
Avoid deterministic language like "the price goes up by bb" — always say "predicted" and "on average." Also avoid causal language: regression describes association, not cause, unless the data came from a randomized experiment. On free-response questions, forgetting the word "predicted" or omitting the units is the most frequent way students lose an otherwise-earned point.

Building the Line from Summary Statistics

You won't always get raw data. The AP exam often hands you five numbers: xˉ\bar{x}, sxs_x, yˉ\bar{y}, sys_y, and rr. From these you can construct the entire line using two formulas.

The slope comes from b=rsysxb = r\frac{s_y}{s_x}. Because sxs_x and sys_y are always positive, the slope always has the same sign as the correlation rr. The intercept then comes from the fact that the line passes through (xˉ,yˉ)(\bar{x}, \bar{y}): a=yˉbxˉa = \bar{y} - b\bar{x}.

Putting these together gives the point-slope form the objective highlights:y^=yˉ+rsysx(xxˉ)\hat{y} = \bar{y} + r\frac{s_y}{s_x}(x - \bar{x})This version makes clear that at x=xˉx = \bar{x}, the predicted value is exactly yˉ\bar{y}. A related idea is r2r^2, the coefficient of determination, which tells you the proportion of variation in yy explained by the linear model — but the mechanics of r2r^2 belong with residuals in the next lesson. For now, be fluent moving from the five summary statistics to a complete equation, and be ready to compute a prediction by plugging an xx value in. Practice keeping units and rounding consistent, because a small arithmetic slip in bb propagates into a wrong intercept and wrong prediction.

Prediction, Residuals, and Avoiding Extrapolation

Once you have y^=a+bx\hat{y} = a + bx, prediction is just substitution: plug in an xx, compute y^\hat{y}. If you also know the actual observed yy, the residual yy^y - \hat{y} tells you how far off the prediction was. A positive residual means the line underestimated (the point sits above the line); a negative residual means the line overestimated.

Extrapolation is using the model to predict for xx-values outside the range of the data used to build it. The danger is that the linear pattern may not continue beyond what you observed — relationships can bend, level off, or reverse. Predicting a person's height from an equation built on ages 5–15 and then plugging in age 40 gives nonsense. On the exam, if you're asked whether a prediction is reliable, check whether xx falls inside the observed range; if not, state that extrapolation makes the prediction unreliable.
ConceptFormula/CheckMeaning
Predictiony^=a+bx\hat{y} = a + bxEstimated response
Residualyy^y - \hat{y}Actual minus predicted
Positive residualy>y^y > \hat{y}Model underpredicted
Extrapolationxx outside data rangePrediction untrustworthy
Always name whether a prediction is interpolation (safe, within range) or extrapolation (risky). This single distinction shows up repeatedly and earns easy justification points.

Key terms

Least-squares regression line (LSRL).
The unique line y^=a+bx\hat{y} = a + bx that minimizes the sum of squared residuals; it always passes through (xˉ,yˉ)(\bar{x}, \bar{y}).
Slope (bb).
The predicted change in the response variable for each one-unit increase in the explanatory variable; b=rsysxb = r\frac{s_y}{s_x}.
Y-intercept (aa).
The predicted value of yy when x=0x = 0; computed as a=yˉbxˉa = \bar{y} - b\bar{x}.
Residual.
The vertical difference between an observed value and its prediction: yy^y - \hat{y}; positive means the model underpredicted.
Predicted value (y^\hat{y}).
The response estimated by the regression line for a given xx; distinct from an actual observed yy.
Extrapolation.
Using the regression line to predict for xx-values outside the range of the observed data, which can produce unreliable results.
Interpolation.
Predicting for an xx-value inside the observed data range, generally more trustworthy than extrapolation.

Worked example

A researcher studies the relationship between hours studied (xx) and exam score (yy) for a class. The summary statistics are xˉ=5\bar{x} = 5 hours, sx=2s_x = 2 hours, yˉ=78\bar{y} = 78 points, sy=8s_y = 8 points, and r=0.75r = 0.75. Find the least-squares regression line, interpret the slope, and predict the score for a student who studies 7 hours.
First find the slope using b=rsysxb = r\frac{s_y}{s_x}. Substituting: b=0.75×82=0.75×4=3b = 0.75 \times \frac{8}{2} = 0.75 \times 4 = 3.

Next find the intercept using a=yˉbxˉ=783(5)=7815=63a = \bar{y} - b\bar{x} = 78 - 3(5) = 78 - 15 = 63.

So the regression line is y^=63+3x\hat{y} = 63 + 3x.

Interpret the slope: for each additional hour studied, the predicted exam score increases by 33 points, on average. Note the words "predicted" and "on average" — required for full credit.

Interpret the intercept: a student who studies 00 hours has a predicted score of 6363 points. Here x=0x=0 is borderline meaningful, so it's an acceptable interpretation.

Now predict for x=7x = 7: y^=63+3(7)=63+21=84\hat{y} = 63 + 3(7) = 63 + 21 = 84 points. Since 77 hours is within a reasonable range near the data (mean 55, sd 22), this is interpolation and is reasonable. Predicting for x=40x = 40 hours would be extrapolation and unreliable.

Practice questions

A least-squares regression line predicting weight (kg) from height (cm) is y^=50+0.9x\hat{y} = -50 + 0.9x. Which statement correctly interprets the slope?
  1. For each 1 cm increase in height, weight increases by exactly 0.9 kg.
  2. For each 1 cm increase in height, predicted weight increases by 0.9 kg on average.
  3. For each 1 kg increase in weight, predicted height increases by 0.9 cm on average.
  4. When height is 0 cm, predicted weight is 0.9 kg.

Answer: For each 1 cm increase in height, predicted weight increases by 0.9 kg on average.

Slope describes the predicted change in the response (yy, weight) per one-unit increase in the explanatory variable (xx, height). It must include "predicted" and "on average" — choice 1 wrongly says "exactly." Choice 3 reverses the variables, and choice 4 describes the intercept, not the slope.
A regression line built from data on cars driven between 1 and 8 years old predicts resale value from age. Explain why using this line to predict the resale value of a 30-year-old car would be unwise, and describe what kind of error this represents.

Answer: This is extrapolation, and it is unwise because 30 years is far outside the observed data range of 1 to 8 years.

The linear relationship was only established for ages between 1 and 8 years. A 30-year-old car lies far outside that range, so we have no evidence the linear pattern continues — resale value might level off (classic/vintage value) or the trend could bend. Predicting there is extrapolation, and any prediction it produces is unreliable. Full credit requires naming extrapolation and referencing the data range.
Given xˉ=10\bar{x} = 10, sx=4s_x = 4, yˉ=200\bar{y} = 200, sy=30s_y = 30, and r=0.6r = -0.6, find the equation of the least-squares regression line.

Answer: y^=2454.5x\hat{y} = 245 - 4.5x

Slope: b=rsysx=0.6×304=0.6×7.5=4.5b = r\frac{s_y}{s_x} = -0.6 \times \frac{30}{4} = -0.6 \times 7.5 = -4.5. Intercept: a=yˉbxˉ=200(4.5)(10)=200+45=245a = \bar{y} - b\bar{x} = 200 - (-4.5)(10) = 200 + 45 = 245. So y^=2454.5x\hat{y} = 245 - 4.5x. The negative slope matches the negative correlation, a quick consistency check.

FAQ

What is the difference between yy and y^\hat{y}?
yy is an actual observed data value, while y^\hat{y} is the value predicted by the regression line for a given xx. The gap between them is the residual, yy^y - \hat{y}. Always use the hat symbol when writing a regression equation to show it produces predictions, not observed data.
Why must slope interpretations include the words 'predicted' and 'on average'?
The regression line gives an average predicted change, not a guaranteed change for every individual. Saying a value increases 'by exactly bb' is deterministic and wrong. AP graders look for language showing you understand the slope describes a predicted, average relationship, so omitting those words commonly costs a point.
How do I get the regression line if I'm only given the mean, standard deviation, and correlation?
Use b=rsysxb = r\frac{s_y}{s_x} for the slope, then a=yˉbxˉa = \bar{y} - b\bar{x} for the intercept, since the line always passes through (xˉ,yˉ)(\bar{x}, \bar{y}). Combine them as y^=yˉ+rsysx(xxˉ)\hat{y} = \bar{y} + r\frac{s_y}{s_x}(x - \bar{x}). You never need raw data to build the line from these five statistics.
When is it okay to interpret the y-intercept?
Only interpret the intercept meaningfully when x=0x = 0 is realistic and within or near the data range. If x=0x = 0 makes no sense in context (like zero height predicting weight), state that the intercept has no practical interpretation and serves only as a mathematical anchor for the line.

Learn this with a teacher, not a page

The Crimsora tutor teaches U2.6 Least Squares Regression live — explaining on a whiteboard, asking you questions, and adapting to where you get stuck.