Deviation 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.
Deviation
Describing data
A deviation is the signed distance from a single data value to the mean, found by subtracting the mean from that value.
A deviation belongs to a single observation, not to a data set. It is written , where is one value and (x-bar) is the mean of all of them, and it keeps the units of the data. The sign is part of the answer: positive puts the value above the mean, negative below it.
For 4, 7, 9, 12, 13 the mean is , so the five deviations are -5, -2, 0, 3, and 4. They add to exactly 0, which is not a fact about this data set: , and is the total by definition, so the terms cancel every time. Squaring first rescues the idea. Those squared deviations are 25, 4, 0, 9, and 16, summing to a sum of squares of 54, which divided by gives a variance of 13.5 and a standard deviation of 3.67.
"The deviation of this data set is 3.67" is a category error and the most common one on this page. Five values have five deviations; 3.67 is the standard deviation, one summary built from all of them. Calling one number the deviation of a whole set throws away the distinction that makes the formula work.
The exact-zero check only holds on an unrounded mean. On a set whose mean comes out as 9.333, rounding it to 9.3 before subtracting leaves the deviations missing zero by a little, a rounding artifact and not an error in the data. A deviation is also not a residual: a deviation measures a value against the mean of its own variable, while a residual, (y minus y-hat), measures an observed response against what a model predicted.
Absolute values are the other way to stop the cancellation. Averaging gives the mean absolute deviation, here. Squaring wins out because squared deviations have algebra behind them that absolute values do not, which is why carries through the rest of the course.
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: , observed minus predicted, where (read y-hat) is the height of the line above that point's . 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 . For the student who studied 5 hours the line gives , and that student scored 71, so the residual is . The line overpredicted that score by 7 points. Doing the same at every 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 . 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.