AP Statistics Least-Squares Regression and Residuals Lesson (Free PDF)
This regression residuals lesson for AP Statistics covers least-squares regression and residuals (Common Core AP STAT 2.6, AP STAT 2.7, AP STAT 2.8, AP STAT 2.9, HSS-ID.B.6, HSS-ID.C.7), with a free PDF to print.
The least-squares regression line minimizes the sum of squared residuals and has the form y-hat = a + bx, with slope b = r(sy/sx). The slope is the predicted change in y per one-unit increase in x, the residual is actual minus predicted, and r squared is the proportion of variation in y explained by the line.
AP Statistics · Common Core State Standards: AP STAT 2.6, AP STAT 2.7, AP STAT 2.8, AP STAT 2.9, HSS-ID.B.6, HSS-ID.C.7
Key facts in this regression residuals lesson
- LSRL: y-hat = a + bx, with b = r sy/sx and a = y-bar – b x-bar; it passes through (x-bar, y-bar).
- Interpret the slope as the predicted change in y per unit of x, in context.
- Residual = actual – predicted; a good linear model has a residual plot with no pattern.
- r squared is the percent of variation in y explained by the linear model; s is the typical prediction error.
- Avoid extrapolation and check for influential points.
What is the least-squares regression line?
A regression line is a straight line that models how the response variable \(y\) changes with the explanatory variable \(x\). The least-squares regression line (LSRL) is the line that minimizes the sum of the squared vertical distances from the points to the line. Its equation is \(\hat{y}=a+bx\).
\[b=r\frac{s_y}{s_x},\qquad a=\overline{y}-b\overline{x}\]
For the car data, \(\hat{y}=26.56-2.25x\), where \(x\) is age in years and \(\hat{y}\) is predicted price in thousands of dollars. The line always passes through \((\overline{x},\overline{y})\).
How do you interpret the slope and intercept?
Slope: for each additional year of age, the predicted price decreases by about $2,252. Intercept: the predicted price of a car of age 0 is about $26,561. Always use the words “predicted” and the context. Use of the line far outside the data range is extrapolation and is unreliable.
What is a residual?
A residual is the actual value minus the predicted value: \(e=y-\hat{y}\). A residual plot graphs residuals against \(x\). Random scatter around zero (no pattern) supports a linear model; a curve means the line is not appropriate.
How do you measure how well the line fits?
The coefficient of determination \(r^{2}\) is the proportion of variation in \(y\) explained by the linear relationship with \(x\). Here \(r^{2}=0.996\), so about 99.6% of the variation in price is explained by age. The standard deviation of the residuals \(s\) measures the typical prediction error: \(s=\sqrt{\frac{\sum e_i^2}{n-2}}\). Here \(s=0.37\), about $374.
Points far from the others in the x direction can be influential: removing them changes the line a lot. Check for such points before you trust a regression.
Regression residuals lesson: questions and answers
What does the slope of the regression line mean?
The slope is the predicted change in the response for each one-unit increase in the explanatory variable. Always state it with ‘predicted’ and with the units and context of the data.
How do I find a residual?
Plug the x value into the regression equation to get the predicted value, then subtract: residual = actual y – predicted y. A positive residual means the point is above the line.
What is extrapolation, and why is it risky?
Extrapolation is predicting for x values outside the range of the data. The pattern may not continue there, so the prediction can be badly wrong.
What does r squared tell me?
It gives the percent of the variation in y that is accounted for by the linear relationship with x. For example, r squared = 0.96 means 96% of the variation in price is explained by age.
When is a point influential?
A point is influential if removing it substantially changes the slope, intercept, or correlation. Points with extreme x values far from the other points are the most likely to be influential.
How to use this regression residuals lesson
Read the definitions first, then follow the worked method line by line and redo the example on paper without looking. When every step makes sense, move on to the worksheet, then check yourself with the quiz.
Download the regression residuals lesson as a PDF with the button below and keep it with your notes.
Download the regression residuals lesson as a PDF with the button below and keep it with your notes.
All AP Statistics chapters: AP Statistics math.
More AP Statistics math
Lessons
See allWorksheets
See allRandom Variables, Expected Value and Combining Variables Worksheet
Inference for the Difference of Two Proportions Worksheet
Mean, Median, Standard Deviation and Outliers Worksheet
Sampling Distributions and the Central Limit Theorem Worksheet
Significance Tests for a Proportion Worksheet
Binomial and Geometric Distributions Worksheet
Tests
See allt Intervals and t Tests for a Mean Test with Point Values
Confidence Intervals for a Proportion Test with Point Values
Chi-Square Tests Test with Point Values
Two Categorical Variables and Two-Way Tables Test with Point Values
Conditional Probability and Independence Test with Point Values
Scatterplots and Correlation Test with Point Values

























