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) |
---|---|---|---|
5 | 95 | 120.19 | -25.19 |
10 | 180 | 146.52 | 33.48 |
15 | 290 | 172.85 | 117.15 |
20 | 95 | 199.18 | -104.18 |
25 | 165 | 225.51 | -60.51 |
30 | 240 | 251.84 | -11.84 |
Let’s present this data in a plot.
As per the above plot:
- Residual for (290, 172.85) is 117.15. It’s a positive residual.
- 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.