Coefficient of Determination vs Residual

Both terms below come up in the same part of the course, and students mix them up. Here is each one defined on its own, side by side, so you can see where they part company.

Coefficient of determination (r²)

Regression and correlation

The coefficient of determination, r-squared, is the fraction of the variation in the response variable that the regression line explains, from 0 to 1.

r2r^2 (read r squared) is the proportion of the variation in the response variable yy that is explained by the linear relationship with the explanatory variable xx. Equivalently, it measures how much of the squared prediction error is removed by using the least-squares line instead of predicting yˉ\bar{y} for everyone:

r2=1sum of squared residualssum of squared deviations of y from yˉr^2 = 1 - \frac{\text{sum of squared residuals}}{\text{sum of squared deviations of } y \text{ from } \bar{y}}

Six students study 1, 2, 3, 4, 5 and 6 hours and score 60, 72, 65, 78, 71 and 86. The least-squares line is y^=58+4x\hat{y} = 58 + 4x. The scores have mean 72, and their squared deviations from 72 sum to 426. The line leaves residuals of -2, 6, -5, 4, -7 and 4, whose squares sum to 146. So r2=1146/426=0.657r^2 = 1 - 146 / 426 = 0.657: about 66 percent of the variation in scores is explained by the linear relationship with study time, and the other 34 percent is not.

The correlation for these data is r=0.8107r = 0.8107, and squaring it returns the same 0.657, which is where the name comes from. Squaring also throws away the sign, so a data set with r=0.8107r = -0.8107 would report the identical r2=0.657r^2 = 0.657. The statistic reports strength of linear fit and never direction, so quote rr alongside it whenever direction matters.

What 66 percent does not mean: that 66 percent of the points lie on the line, that study time causes 66 percent of the score, or that predictions from the line are 66 percent accurate. It is a statement about variation and about nothing else.

An r2r^2 close to 1 also does not confirm that a line was the right model. A curved relationship can still produce a high r2r^2 while the residual plot shows an obvious arc, and it is that plot, not the size of r2r^2, that decides whether a linear model belongs on the data. r2r^2 is also unitless, which makes it easy to compare across settings but useless for saying how wrong a single prediction is likely to be. The standard deviation of the residuals answers that second question, in the units of yy, and the two statistics are usually reported together.

Full entry for coefficient of determination

Residual

Regression and correlation

A residual is the difference between an observed y-value and the value the regression line predicts for it: observed minus predicted.

A residual belongs to one data point and one fitted line, and the order of the subtraction is fixed: residual=yy^\text{residual} = y - \hat{y}, observed minus predicted, where y^\hat{y} (read y-hat) is the height of the line above that point's xx. The sign is where the meaning lives. A positive residual puts the observation above the line, so the model underpredicted it, and a negative residual puts it below, so the model overpredicted.

Six students study 1, 2, 3, 4, 5 and 6 hours and score 60, 72, 65, 78, 71 and 86. The least-squares line for them is y^=58+4x\hat{y} = 58 + 4x. For the student who studied 5 hours the line gives y^=58+4(5)=78\hat{y} = 58 + 4(5) = 78, and that student scored 71, so the residual is 7178=771 - 78 = -7. The line overpredicted that score by 7 points. Doing the same at every xx gives residuals of -2, 6, -5, 4, -7 and 4.

The error that costs points is the reversed subtraction. "The residual is 7, so the line missed by 7" keeps the size and throws the direction away, and computing predicted minus observed flips the sign of every residual in the table, turning each overprediction into an underprediction. Say observed minus predicted every time, and read a negative residual as the line sitting above the data point.

Two things bound what a single residual can tell you. It is measured against one particular line, so change the line and every residual changes with it. And for a least-squares line fitted with an intercept the residuals add to exactly zero: here 2+65+47+4=0-2 + 6 - 5 + 4 - 7 + 4 = 0. Their mean is zero for a good fit and for a hopeless one alike, which is why fit gets judged from the squared residuals and from the shape of the residual plot, never from their average.

Residuals are topic 5.4 in Unit 5, Regression Analysis, of the Fall 2026 AP Statistics course.

Full entry for residual

Where each one fits in the course