how to calculate residuals manually - Search