Advertisement

Residual calculator

A residual is an observed response minus its model prediction. Supply matching predictions, evaluate a specified line, or fit a line from paired observations.

Calculator

Sum of squared residuals
0.250000
Mean squared residual
0.083333
Mean residual
0.166667
Observed and predicted values
ObservedPredictedResidualSquared residual
2.0000002.0000000.0000000.000000
4.0000003.5000000.5000000.250000
5.0000005.0000000.0000000.000000

Advertisement

How this calculator works

The fitted-line mode estimates an intercept and slope from the supplied x and observed-response lists before calculating residuals. Residuals retain the units of the response. Positive values mean the model underpredicts; negative values mean it overpredicts. Squaring prevents opposite errors from cancelling. This page reports descriptive MSE with divisor n. Estimating an error variance after fitting parameters requires residual degrees of freedom instead. A residual table helps identify outliers, but cannot establish independence or constant variance by itself.

Formula

eᵢ = yᵢ - ŷᵢ; SSE = Σeᵢ²; descriptive MSE = SSE/n.

Worked example

Observed values 2, 4, 5 and predictions 2, 3.5, 5 give residuals 0, 0.5, 0 and SSE 0.25. Observations 1, 3 and predictions 2, 2 give residuals -1, 1 and MSE 1.

Advertisement

Frequently asked questions

Is residual the same as true error?

A residual uses a fitted prediction. A population error refers to the unknown underlying model.

Why can the mean residual be zero with large errors?

Positive and negative residuals cancel. SSE or MSE measures their combined size.

Is this MSE unbiased for error variance?

The descriptive mean uses n. After fitting p parameters, the usual variance estimate uses SSE/(n - p).

Sources

Advertisement