Skip to content
FiftyCalc Free calculators for all 50 states

Residual Calculator

Test cases replayed : 2 of 2 match · Methodology · No outside source listed

Enter a data point (x, y) and the intercept and slope of the regression line to get the predicted value and the residual of that point.

Result

Sample figures

Residual (y − ŷ)—

Predicted value (ŷ) —

  • Squared residual—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

Residual Calculator

x value of the data point: enter a number. Prefilled example: 4.

Observed y value: enter a number. Prefilled example: 12.

Intercept of the line (b0): enter a number. Prefilled example: 2.

Slope of the line (b1): enter a number. Prefilled example: 2.5.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. x value of the data point: enter a number.
  2. Observed y value: enter a number.
  3. Intercept of the line (b0): enter a number.
  4. Slope of the line (b1): enter a number.
  5. Read the result: Residual (y − ŷ); the panel also shows Predicted value (ŷ) and Squared residual.

How this calculator works

Predicted value ŷ = b0 + b1 × x, from the least-squares (or any) line y = b0 + b1x. Residual e = y − ŷ: the observed value minus the predicted value.

A positive residual means the point lies above the line, a negative one below it. Least-squares regression chooses b0 and b1 so that the sum of the squared residuals is as small as possible.

The formula

  1. Yh=b0+b1×x
  2. Res=y−Yh
Symbols used in the formula
SymbolMeaning
xx value of the data point
yObserved y value
b0Intercept of the line (b0)
b1Slope of the line (b1)
YhPredicted value (ŷ)
ResResidual (y − ŷ)

Worked example

x value of the data point4
Observed y value12
Intercept of the line (b0)2
Slope of the line (b1)2.5
Predicted value (ŷ)12
Squared residual0
  1. Yh=2+2.5×4=12
  2. Res=12−12=0

Residual (y − ŷ) 0

Each step uses the unrounded value of the step before it; figures on this page are rounded for display.

Frequently asked questions

What is the residual of the point (4, 12) for the line y = 2 + 2.5x?

ŷ = 2 + 2.5 × 4 = 12, so the residual is 12 − 12 = 0: the point is on the line.

What does a negative residual mean?

The observed value is below the value the line predicts: the line overestimates that point.

Questions answered

Related calculators