# Calculating Diagonal Elements of $(X^TX)^{-1}$ From R Output

With $$X$$ being the design matrix, calculate the diagonal elements of the matrix $$(X^TX)^{-1}$$ using only the R output. I found the diagonal elements to be $$\frac{1}{n SSX} \bigg[n,\sum X_{i1}^2, \sum X_{i2}^2 \bigg]$$ but I don´t see any way of calculating this based on the R output.

Hint: Find the formula for the standard errors of the coefficient estimators. Notice also that these standard errors are given to you in the output.

• So $Var(\hat{\beta}) = \sigma^2 (X^TX)^{-1}$ But I don't see how to extract diagonal elements this way? Also, isn't $\hat{\beta}$ a $px1$ matrix, while $(X^TX)^{-1}$ is an $nxn$ matrix?
– Pame
Apr 8, 2020 at 14:10
• It's a $p \times p$ matrix
– JTH
Apr 8, 2020 at 14:24
• Still doesen´t make much sense if the left hand side is a $px1$ matrix and the right hand side a $pxp$ matrix.
– Pame
Apr 9, 2020 at 7:11
• Please have a look here.
– Ben
Apr 9, 2020 at 7:18
• Okay, so then the diagonal elements of $(X^TX)^{-1}$ are given by $\frac{Var(\beta_i)}{\sigma^2}$ ?
– Pame
Apr 9, 2020 at 9:01