Residual Calculator
Calculate residuals from actual and predicted values.
Enter y and y-hat pairs to get each residual, sum of squared errors, R-squared, and standard error.
Residuals are the differences between actual and predicted values in a regression or model: e_i = y_i - y-hat_i. They tell you how far off each prediction is, and in which direction.
Positive residuals mean the model under-predicted; negative residuals mean it over-predicted. After fitting a regression line, the residuals should scatter randomly around zero with no obvious pattern. If they show a curve, a funnel shape, or trend with x, the model is misspecified or violates regression assumptions.
This calculator computes four summary statistics from the residuals:
SSE (Sum of Squared Errors) = sum of (y_i - y-hat_i)^2. This is the total squared prediction error. Minimizing SSE is literally how ordinary least squares regression works — the line is chosen to make SSE as small as possible.
SST (Sum of Squares Total) = sum of (y_i - y-bar)^2. This measures how variable the actual data is around its own mean. SST is fixed given the data; it does not depend on the model.
R-squared = 1 - SSE/SST. This is the fraction of the variance in y explained by the model. An R-squared of 0.85 means the model accounts for 85% of the variability in the data. An R-squared of 0 means the model does no better than just predicting the mean every time.
RSE (Residual Standard Error) = sqrt(SSE / (n - 2)). This estimates the typical size of a residual, adjusted for the degrees of freedom used in fitting. In simple linear regression, 2 degrees of freedom are used for the intercept and slope.
Large individual residuals are worth investigating. They may indicate outliers, data entry errors, or observations that genuinely behave differently from the rest.
How we build and check this calculator
This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.
SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.