What a residual is
A residual is the difference between an observed data point and the value a model predicts for it. In symbols, for a fitted regression the residual of the i-th point is ei = yi − ŷi, where yi is the observed (actual) value and ŷi is the predicted or "fitted" value that the model produces for that same x. This calculator computes exactly that single quantity, along with its absolute size and the residual expressed as a percentage of the observed value.
The sign carries the meaning. A positive residual means the observed value is larger than the prediction — the model under-predicted, and the point plots above the regression line. A negative residual means the observed value is smaller than the prediction — the model over-predicted, and the point plots below the line. A residual of zero means the point lands exactly on the line.
The formula
residual = observed − predicted, or e = y − ŷ. That order matters: it is always actual minus fitted, never the reverse. For example, if a least-squares line predicts a house sells for $48,000 (in some scaled units) and it actually sells for $52,000, the residual is 52,000 − 48,000 = +4,000, telling you the model was $4,000 low on that sale.
Residual vs. error
The two terms are related but not identical. The error (or disturbance) is the gap between the observed value and the unknown true population value; it can never be measured directly because the true model is never known. The residual is the gap between the observed value and the value estimated by your fitted model. Because the fitted value is something you can actually compute, residuals are observable, and they act as our best estimates of the invisible errors.
Why residuals matter
Residuals are the raw material of nearly every regression diagnostic. In ordinary least squares the line is chosen precisely to minimize the sum of squared residuals (Σe²). Once fitted, the residuals should look like random noise: for a well-specified model they scatter around zero with roughly constant spread and no pattern. A residual plot that fans out, curves, or drifts is a warning that an assumption — linearity, constant variance (homoscedasticity), or independence — has been violated. Individual large residuals also flag potential outliers or data-entry mistakes worth investigating.
Reference points
- The residuals from an ordinary-least-squares fit always sum to zero (and average to zero) when the model includes an intercept — a useful check when you compute all of them.
- A residual is "small" or "large" only relative to the spread of the data. Divide a residual by the residual standard error to get a standardized residual; values beyond roughly ±2 to ±3 are commonly treated as unusual.
- The percent residual, residual ÷ observed × 100, puts the miss on a relative scale, which is handy when comparing points of very different magnitudes.