# Simple linear regression exercise

I'm trying to do an exercise but I can't figure out how to proceed. OLS is run for this model, with 100 observations. $$y_i=b_0+b_1x_i+\epsilon_i$$ The results are $$\hat\beta =\begin{pmatrix} 9 \\1 \end{pmatrix}$$ $$V(\hat\beta)=\hat\sigma^2 (X'X)^{-1}=\begin{pmatrix} 3 &0.12 \\ 0.12 &0.064 \end{pmatrix}$$ It asks me to calculate $$e'e$$ aka the sum of squared residuals. I don't know what to do. I know in simple regressione the coefficients and variances have formulas that have to do with averages and variances of y and x. But I don't have any info on the individual observations. Could anyone tell me what I'm missing or how to solve this?

Notice that

$$X'X = \begin{pmatrix} n & \sum x_i\\ \sum x_i & \sum x_i^2 \end{pmatrix}$$

since you know $$n$$, there are three unknowns that determine the elements of the matrix $$\text{Var}(\hat \beta)$$ - $$\sum x_i, \sum x_i^2$$ and $$\hat\sigma^2$$. Use the three indpendent elements of the matrix to find those quantities, and then assuming

$$\hat\sigma^2 = \frac{e'e}{n-2}$$

you can find $$e'e.$$

• Thanks, this definitely makes sense. However I don't really know the formulas for the single entries of the variance covariance matrix in function of the three elements you listed. How can I derive them? May 28, 2022 at 20:34
• Simply invert the 2-by-2 matrix May 28, 2022 at 20:54
• Thanks, I managed to solve it now! May 29, 2022 at 15:06

This is how you would calculate the sum of squared residuals -

1. Use the value of your coefficients to come up with a prediction for all 100 values, $$\hat{y}$$

2. Next compute the difference, for all observations, between the real $$y$$ and predicted value $$\hat{y}$$, $$y - \hat{y}$$

3. Sum the square of those differences $$\sum_{i=1}^{i=100}(y_i - \hat{y_i})^2$$

• I know the formula, but I don't have the values for x to calculate the predictions May 28, 2022 at 20:02