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 how far one data value sits from the mean, found by subtracting the mean from that value.

A deviation describes a single observation rather than the whole data set, and you write it as xixˉx_i - \bar{x}, where xˉ\bar{x} (x-bar) is the mean. A positive deviation puts the value above the mean and a negative deviation puts it below. In the data 2, 4, 6, 8 the mean is 5, so the four deviations are -3, -1, 1, and 3. They add to zero, which is true for every data set and is exactly why the variance squares the deviations before adding them up.

Full entry for deviation

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 measures how far off the line is for a single point, so a positive residual sits above the line and a negative one below. It equals residual=yy^\text{residual} = y - \hat{y}, the observed response minus the predicted response y^\hat{y} (read y-hat). For example, if the line predicts 72 but a student actually scored 80, the residual is 8072=880 - 72 = 8. Least-squares regression chooses the line that makes the sum of the squared residuals as small as possible.

Full entry for residual

Where each one fits in the course