Residuals Calculator

Calculate residuals fast from observed and predicted values. Inspect fit, error metrics, and outliers clearly. Export tables to share results with your team today.

Calculator

Choose how predicted values are supplied or created.
Applies to displayed results and downloads.
Studentized uses leverage; only available in line modes.
Common values: 2, 2.5, or 3.
Useful when predictions have constant bias.
Adds leverage and Cook’s distance when available.
Observed + predicted input
Enter one row per line as: observed, predicted. Commas, tabs, semicolons, or spaces work.

Example data table

#XObservedPredictedResidual
112.102.000.10
222.903.00-0.10
333.704.00-0.30
444.205.00-0.80
556.106.000.10
Residual = Observed − Predicted. Positive means the model under-predicted.

Formula used

  • Residual: eᵢ = yᵢ − ŷᵢ
  • SSE: Σ eᵢ²
  • MSE: SSE / n
  • RMSE: √(MSE)
  • MAE: (1/n) Σ |eᵢ|
  • Z residual: (eᵢ − mean(e)) / sd(e)
  • Line fit: ŷ = a + bX, where b = Σ(x−x̄)(y−ȳ) / Σ(x−x̄)² and a = ȳ − b x̄
  • Studentized residual (line modes): eᵢ / (s √(1−hᵢᵢ)), where hᵢᵢ = 1/n + (xᵢ−x̄)²/Σ(x−x̄)² and s = √(SSE/(n−2))

How to use this calculator

  1. Pick a mode: supply predicted values, fit a line, or enter a custom line.
  2. Paste your data with one row per line. Use commas, tabs, semicolons, or spaces.
  3. Choose an outlier rule and threshold if you want flags.
  4. Click Calculate to view summary metrics, a residual plot, and a full table.
  5. Use the download buttons to export results for reports or audits.

Residual meaning and direction

A residual is the difference between an observed value and the model’s prediction. Positive residuals mean the model under-predicted, while negative residuals mean it over-predicted. In a well-calibrated model, residuals average near zero and fluctuate without trend across the fitted range. A persistent nonzero mean indicates systematic bias, such as an intercept shift or measurement offset.

Scale, units, and comparability

Residual size must be interpreted in the same units as the outcome. A residual of 5 may be trivial in annual revenue, but serious in blood pressure. Compare residuals to the outcome’s spread, such as the sample standard deviation, and consider standardized residuals when you need a unitless view. When targets span orders of magnitude, a log transform can stabilize variability and produce residuals that are more comparable across low and high values.

Error summaries that support decisions

This calculator reports SSE, MSE, RMSE, and MAE. MAE describes the typical absolute miss, while RMSE penalizes large misses more strongly. If MAE is 3 and RMSE is 6, errors are likely heavy-tailed or influenced by a few large points. Compare RMSE to a tolerance, such as “±4 units acceptable,” to decide if the model is fit. Use df-adjusted RSE when fitting a line and comparing models trained on the same sample.

Patterns that expose model issues

A residual plot should look like random scatter around zero. Curvature suggests missing nonlinear terms, and a funnel shape suggests non-constant variance. Clusters of positive residuals in one region can signal bias from omitted variables or a segmentation problem. In time-ordered data, runs of same-sign residuals can indicate autocorrelation, meaning errors are not independent. Refit and recheck after each feature change, transformation, or filtering decision.

Outliers, leverage, and influence

Flagging large |residual| or |z residual| values helps surface unusual cases. In line-based modes, studentized residuals incorporate leverage, and Cook’s distance highlights points that move the fitted line. As a practical rule, investigate |studentized| ≥ 2 and Cook’s D above about 4/n, then decide whether to correct data, transform targets, or keep the point. Also watch leverage values above 2p/n, because high-leverage points can dominate slope estimates even when residuals look modest.

FAQs

1) What does a “good” residual plot look like?

It shows points scattered randomly around zero with roughly constant spread. No curves, no clear trend, and no funnel shape. That pattern suggests the model form is reasonable and the error variance is stable.

2) Why is RMSE usually higher than MAE?

RMSE squares residuals before averaging, so larger errors get much more weight. MAE treats every miss linearly. If RMSE is much bigger than MAE, a few large residuals are likely dominating.

3) When should I center residuals to mean zero?

Centering is helpful when predictions have a constant bias you want to remove for analysis or comparison. It does not fix the model; it shifts residuals. Keep uncentered residuals when evaluating absolute calibration.

4) What are studentized residuals used for?

They scale each residual by its estimated standard error and leverage, making values comparable across X. Use them in line modes to spot unusual points more fairly, especially when leverage varies.

5) What outlier threshold is a reasonable starting point?

Common starting thresholds are 2 for quick screening and 3 for stricter flags. For absolute residual rules, choose a domain tolerance. For z or studentized rules, pair the threshold with manual review.

6) Can I compute residuals without fitting a line?

Yes. Use the Observed + Predicted mode and paste paired values. The calculator will compute residuals and error summaries directly, which is useful when predictions come from any external model.

Related Calculators

Multiple Regression CalculatorSimple Regression CalculatorR Squared CalculatorCorrelation Coefficient CalculatorT Statistic RegressionTrend Line CalculatorRegression Equation FinderRegression Diagnostics ToolAutocorrelation Test CalculatorShapiro Wilk Calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.