Y-Hat 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.

Predicted value (y-hat)

Regression and correlation

The predicted value y-hat is the response a regression model gives for a chosen x, found by substituting that x into the equation of the line.

The predicted value y^\hat{y} (read y-hat) is the height of the fitted line at a chosen xx. It is manufactured by the model, not measured on anybody. That is the entire job of the hat: yy is the number in the data set and y^\hat{y} is the number the line returns for the same individual, and the two are equal only by coincidence.

Take six students who study 1, 2, 3, 4, 5 and 6 hours and score 60, 72, 65, 78, 71 and 86. Their least-squares line is y^=58+4x\hat{y} = 58 + 4x. At x=4x = 4 the predicted value is y^=58+4(4)=74\hat{y} = 58 + 4(4) = 74. The student who actually studied 4 hours scored 78, so observed equals predicted plus residual: 78=74+478 = 74 + 4. Run every xx through the line and the six predicted values are 62, 66, 70, 74, 78 and 82, not one of which matches the score that student earned.

The sentence to avoid is "the model says a student who studies 4 hours will score 74." The line returns the same 74 for anyone who studied 4 hours, and real students scatter around that value: in these data the misses run as large as 7 points. Written properly it is "the model predicts about 74 points," and the word predicted is what an AP interpretation is graded on.

A predicted value inherits every limit of the line that produced it. Substituting an xx the study never reached is extrapolation, and the arithmetic gives no warning: x=12x = 12 hours returns 58+4(12)=10658 + 4(12) = 106 on a test scored out of 100. Predicted values also depend on the direction of the fit, so this line predicts scores from hours and cannot be rearranged to predict hours from scores.

Full entry for y-hat

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