AP® Statistics · Unit 5 · Topic 5.5
r-Squared and the Spread of the Residuals
R-squared is the fraction of variation in y that the regression line explains using x, found by squaring the correlation r. It tells you how much tighter the data hug the line compared to just guessing y-bar for everything.
Start with a baseline: if you knew nothing about x, your best guess for every y-value would be y-bar, and your errors would be the deviations from y-bar. Fitting a regression line gives you a better guess for each point, based on x, and the leftover errors are the residuals. R-squared compares the spread of those residuals to the spread around y-bar. Specifically, it's the proportion of the total variation in y that disappears once you account for x through the line. Squaring r turns a measure of direction and strength on a -1 to 1 scale into a percentage of variation explained, which is a quantity that actually makes sense to add, subtract, and interpret as 'how much.'
A value like r-squared = 0.90 means 90% of the variation in y is explained by the linear relationship with x, leaving 10% unexplained, scattered in the residuals as leftover variation from other causes or randomness. The tighter the points hug the line, the smaller that leftover residual spread gets, and the standard deviation of the residuals shrinks right along with it. That standard deviation, often called s, measures the typical size of a prediction error in the original units of y.
R-squared sits right next to residual plots in this unit for a reason: a high r-squared can't rescue a bad model choice. Data curving gently can still produce a high r-squared because the line passes close to the curve overall, even though a line is the wrong shape. Always check the residual plot for leftover pattern before trusting what r-squared seems to promise.
Key terms
- r-squared
- The square of the correlation, giving the proportion of variation in y explained by the linear relationship with x.
- residual
- The difference between an observed y-value and the y-value predicted by the regression line.
- y-bar baseline
- The mean of y, used as the no-information guess for every point before fitting a line.
- standard deviation of residuals
- A measure, in the units of y, of the typical size of prediction errors from the regression line.
Watch it explained
- How it worksHow does r squared compare the spread around the line to the spread around y-bar?
- Worked exampleFind r squared and interpret it when r = 0.84 for height predicting arm span.
- Common mistakeWhy isn't a high r squared evidence that a linear model was the right choice?
- Going furtherWhat happens to the standard deviation of the residuals when the fit tightens?
Check yourself
End of topic.