[Math] How to calculate fitted values and residuals from a set of data

data analysisleast squaresregressionstatistics

Given a set of data with 11 observations of two variables (response and predictor), I've been asked to "calculate the fitted values $\hat y_i = \hatα + \hatβx'_i $ and residuals $e_i = y_i − \hat y_i$ by hand".

What is the question asking me to do here? I have thus far estimated the regression line for the data in the form $\hat y_i = \hatα + \hatβx'_i $ by calculating the coefficients α & β, but I presume this doesn't answer the original question alone. Where do I go from here? Thanks.

Best Answer

If you have calculated $\hat{\alpha}$ and $\hat{\beta}$ you can compute the 11 values of $\hat{y_i}$ by plugging in the 11 values of $x_i$.

Compare the value predicted by the regression, $\hat{y_i}$, and the actual value it should be $y_i$.

Their difference is the residual.

Related Question