AP Statistics Least-Squares Regression and Residuals Lesson: Notes and Examples (Free PDF)
This linear regression 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.
Key takeaway: This lesson on least-squares regression and residuals helps AP Statistics students fit a line to paired data and judge how well it works.
- Topic: Least-Squares Regression and Residuals (AP Statistics)
- Content: One-page lesson with a definition, a worked example and key facts
- 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
- Answers: Explanations included
- Format: Free printable PDF, US Letter, black and white
Key takeaway: A clear AP Statistics lesson on Least-Squares Regression and Residuals, with definitions, rules and worked examples: what is the least-squares regression line, how do you interpret the slope and intercept and what is a residual. Read it before the practice worksheet; free to print or download as a PDF.
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.
This lesson on least-squares regression and residuals helps AP Statistics students fit a line to paired data and judge how well it works. First, you find the line from summary statistics. Then you interpret its slope and intercept and use residuals to check the fit.
The lesson covers the least-squares line, prediction, residuals and residual plots, r squared, the standard deviation of residuals, extrapolation, and influential points. It also teaches how to read computer output. Plan about forty minutes, and write every interpretation in context with units.
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 linear regression 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.
Linear regression 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.
Common mistakes with this linear regression lesson
- Interpreting the slope as the value of y for each x. Also, the slope is the predicted change in y for each one-unit increase in x, and the sentence must say predicted.
- Giving the intercept as meaningful when x equal to zero makes no sense. If the data do not include x near zero, say that the intercept has no practical meaning.
- Computing a residual as predicted minus actual. A residual is actual minus predicted, so a positive residual means the model underestimated.
How to study this chapter
- Interpret slope and intercept in a full sentence with the variables named. Include the word predicted and the units.
- Always look at the residual plot. Also, a curve or a funnel shape means that a straight line is not a good model, whatever r says.
- Teachers can ask students to remove one point and recompute the line, which shows influence directly. Doing this every time makes the method automatic.
Download the linear regression lesson as a PDF with the button below and keep it with your notes.
More questions about linear regression lesson
How do you find the slope and intercept from summary statistics?
Use slope equal to r times sy over sx, then intercept equal to the mean of y minus the slope times the mean of x. Also, the line always passes through the point of means.
What does the standard deviation of the residuals tell you?
It is the typical size of a prediction error, in the units of y. Also, a small value means the points sit close to the line. It is often written as s and is found from the residuals.
How do you read computer output for regression?
Find the coefficients column. Also, the constant row gives the intercept, and the row for the explanatory variable gives the slope. R squared and s appear below the table. Write the steps in order, then check the result against the original question.
All AP Statistics chapters: AP Statistics math.
Free printable PDF
AP Statistics Least-Squares Regression and Residuals Lesson: Notes and Examples
Download PDFMore AP Statistics math
Lessons
See allRandom Variables, Expected Value and Combining Variables Lesson: Notes and Examples
Variables and Categorical Data Displays Lesson: Notes and Examples
Graphs of Quantitative Data and Shape Lesson: Notes and Examples
Inference for the Slope of a Regression Line Lesson: Notes and Examples
Inference for the Difference of Two Proportions Lesson: Notes and Examples
Binomial and Geometric Distributions Lesson: Notes and Examples
Worksheets
See allConfidence Intervals for a Proportion Worksheets with Answers
z-Scores and the Normal Distribution Worksheets with Answers
t Intervals and t Tests for a Mean Worksheets with Answers
Inference for the Slope of a Regression Line Worksheets with Answers
Inference for the Difference of Two Means Worksheets with Answers
Sampling Distributions and the Central Limit Theorem Worksheets with Answers
Tests
See allInference for the Difference of Two Means Test with Answer Key
Significance Tests for a Proportion Test with Answer Key
t Intervals and t Tests for a Mean Test with Answer Key
Inference for the Slope of a Regression Line Test with Answer Key
Sampling Methods and Bias in Surveys Test with Answer Key
Binomial and Geometric Distributions Test with Answer Key
Quizzes
See allRandom Variables, Expected Value and Combining Variables Quiz: 10 Questions with Answers
Least-Squares Regression and Residuals Quiz: 10 Questions with Answers
Conditional Probability and Independence Quiz: 10 Questions with Answers
Sampling Methods and Bias in Surveys Quiz: 10 Questions with Answers
Graphs of Quantitative Data and Shape Quiz: 10 Questions with Answers
Chi-Square Tests Quiz: 10 Questions with Answers

























