Handeware
Math

Residual

1
Predicted value
13

Linear Regression Residual Calculator

A residual is the gap between what you measured and what a straight-line model predicted for the same input. A positive residual means the actual value was above the line, and a negative one means it was below.

How it works

Use the line's equation, predicted = intercept + slope times x, to get the predicted value. Then subtract it from the measured value: residual = actual minus predicted.

Residuals are used to check how well a line fits. Small residuals with no pattern are a good sign, and a pattern in them suggests the line is missing something.

Worked example

At an x of 6, the line predicts 13. The measured value was 14, so the residual is 1.

Questions

Where do the slope and intercept come from?

A regression tool or spreadsheet fits them to your data. This page uses whatever values you enter, so check where yours came from.

Why do some tools square the residuals?

Squaring makes every gap positive, so the errors can be added up. Methods that do this are called least squares.

Is a residual of zero good?

It means the point sits exactly on the line. That is rare with real measurements, so a small residual is usually enough.

More like this

All Math calculators