Residual is the vertical distance between the observed actual value (dependent variable) and the predicted value (generated by regression equation).

Formula to calculate Residual

e = y – ŷ

Here,
e = Residual
y = Observed Actual value
ŷ = Predicted value

1) Observed Value (y) higher than the Predicted value (ŷ) – Positive Residual
2) Predicted value (ŷ) higher than the Actual Value (y) – Negative Residual

Calculating Residual by hand

(x)(y)(ŷ)(e)
595120.19-25.19
10180146.5233.48
15290172.85117.15
2095199.18-104.18
25165225.51-60.51
30240251.84-11.84

Let’s present this data in a plot.

Residual

As per the above plot:

  1. Residual for (290, 172.85) is 117.15. It’s a positive residual.
  2. And, for data point (95, 199.18), the residual is -104.18. A negative residual.

Take Note:

  • all data point has one residual.
  • It is better to have the residual is closer to 0.