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?


2 Answers 2


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.$

  • $\begingroup$ 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? $\endgroup$
    – Francesco
    May 28, 2022 at 20:34
  • $\begingroup$ Simply invert the 2-by-2 matrix $\endgroup$
    – J. Delaney
    May 28, 2022 at 20:54
  • $\begingroup$ Thanks, I managed to solve it now! $\endgroup$
    – Francesco
    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$

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.