Calculates the difference between the observed value and the predicted value from a regression model.