::
Residuals are very closely related to errors but they are not the same.
When e.g. calculating variance and standard deviation, residuals are the deviations each observed value from the observed sample mean.
Errors are when you’re stating deviations of observed values from the true population mean.
Error vs residual example
Say you’re rolling a fair six-sided die 5 times, with the results:
- Roll 1: 3
- Roll 2: 6
- Roll 3: 2
- Roll 4: 4
- Roll 5: 1
Observed sample mean: ( 3+ 6+ 2+ 4+ 1 ) / 5 = 3.2
True mean: 3.5, which we know from a fair die is (1 + 2 + 3 + 4 + 5 + 6) / 6
Error vs residual example for roll 1:
- Roll 1 residual = 3 – 3.2 = -0.2
- Roll 1 error = 3 – 3.5 = -0.5
In this example the true mean is observable but in most cases it may not be (such as the mean height of the entire UK population).