AP Statistics Least-Squares Regression and Residuals Lesson (Free PDF)

AP Statistics math lesson: Least-Squares Regression and Residuals – Maths PDFCover of the book AP Statistics Math Lessons (PDF)Download as a PDFThe AP Statistics math lessons bookPrintable PDFSee the book ›


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

Key facts
  • 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}\]

0123456789Age of car (years)051015202530Price ($1,000s)
Least-squares line for car price (in $1,000s) against age: price-hat = 26.56 – 2.25 (age). Dashed segments are residuals.

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?

Residualactual – predictedPositivepoint above linemodel too lowNegativepoint below linemodel too high
Residual = y – y-hat.

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.

0123456789Age of car (years)-2-1012Residual
A residual plot with no pattern: a linear model is appropriate.
012345678910x-2-1012Residual
A curved residual pattern signals that a straight line is not the right model.

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.

PredictorCoefSE CoefConstant26.5610.2915Age-2.2520.0577S = 0.3741R-Sq = 99.6%
Computer output: intercept, slope, S, and R-Sq.

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.

Voter.. post

Free printable PDF

AP Statistics Least-Squares Regression and Residuals Lesson

US Letter68 KBPrints in black and white

Download PDF