In linear regression, a residual is calculated as:
The predicted value minus the actual value
The actual value minus the predicted value
The square root of the correlation coefficient
The difference between the slope and intercept