Residual Calculator

Enter an observed value and its predicted (fitted) value to get the residual (observed − predicted), the percent residual, and whether your model over- or under-predicted.

Quick Facts

Formula
residual = observed − predicted (e = y − ŷ)
Positive residual = model under-predicted (point above the line); negative = over-predicted.

Your Results

Calculated
Residual (y − ŷ)
-
Observed minus predicted
Absolute residual
-
Size of the miss
Percent residual
-
Residual ÷ observed × 100
Direction
-
Over- or under-prediction

Ready

Enter the observed and predicted values, then calculate.

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.

Frequently Asked Questions

What is the formula for a residual?
A residual is observed value minus predicted value: e = y − ŷ. If a regression line predicts 48 and the actual data point is 52, the residual is 52 − 48 = +4. Keep the order actual-minus-fitted so the sign is meaningful: positive means the model under-predicted, negative means it over-predicted.
What does a positive or negative residual mean?
A positive residual means the observed value is above the prediction, so the point sits above the regression line and the model under-shot. A negative residual means the observed value is below the prediction, so the point sits below the line and the model over-shot. A residual of exactly zero means the point lies on the line.
What is the difference between a residual and an error?
The error is the difference between the observed value and the true (population) value, which is unknowable. The residual is the difference between the observed value and the value your fitted model estimates. Residuals are computable and are used as estimates of the errors.
How do I get the predicted value to plug in?
The predicted value ŷ comes from your fitted model evaluated at that point's x. For a simple linear regression ŷ = a + b·x, substitute the point's x into the fitted equation. Then enter your actual measured y as the observed value and that ŷ as the predicted value here.