1

I have the following R output with several values omitted. I am trying to find what the t value of two estimates, $\widehat{B}_0$, $\widehat{B}_1$

1 > summary(lm(y ~ x))
2 Coefficients:
3             Estimate  Std. Error   t value    Pr(>|t|)
4 (Intercept) -10.805   XXXXX        XXXXX      XXXXX
5 x             3.463   XXXXX        XXXXX      XXXXX
6 ---
7 Signif. codes: 0 ’***’ 0.001 ’**’ 0.01 ’*’ 0.05 ’.’ 0.1 ’ ’ 1
8
9 Residual standard error: 38.82 on 45 degrees of freedom
10 Multiple R-squared: XXXXX, Adjusted R-squared: XXXXX
11 F-statistic: XXXXX on 1 and 45 DF, p-value: 0.01027
12
13 > sig.hat<-summary(lm(y  x))$sigma
14 > X<-cbind(1,x)
15 > sig.hatˆ2*solve(t(X) %*% X)
16                       x
17    32.4213203  0.7787438
18 x  0.7787438   1.6709619
19 > (SST<-sum((y-mean(y))ˆ2))
20 [1] 78620.22

I know that $t_j = \dfrac{\widehat{B}_j}{\operatorname{e.s.e}(\widehat{B}_j)}$, but since $\operatorname{e.s.e}(\widehat{B}_j)$ is missing as well, I am not sure how to calculate the t values.

1 Answers1

0

The standard errors that you seek can be found by taking the square roots of the diagonal entries of the output sig.hat^2 * solve(t(X) %*% X). However, we do not know


If $y_i \sim N(\beta_0 + \beta_1 x_i, \sigma^2)$ is your model, then the covariance matrix of $(\hat{B}_0, \hat{B}_1)$ is $\sigma^2 (X^\top X)^{-1}$ where $X$ is an $n \times 2$ matrix obtained by the cbind(1, x) code (e.g. see here). In particular, the variances of $\hat{B}_0$ and $\hat{B}_1$ are the diagonal entries of $\sigma^2 (X^\top X)^{-1}$ respectively.

However, we do not know $\sigma^2$. If we instead use $\hat{\sigma}^2 := \frac{1}{n - 2} \sum_{i=1}^n (y_i - \hat{B}_0 - \hat{B}_1 x_i)^2$ to compute $\hat{\sigma}^2 (X^\top X)^{-1}$, then the square root of the diagonal entries are the standard errors of $\hat{B}_0$ and $\hat{B}_1$ respectively, and can be used to perform $t$-tests.

angryavian
  • 89,882
  • So the standard error of $B_0$ would be $\sqrt{32.4213203}$, and for $B_1$ would be $\sqrt{1.6709619}$? – jon givony Dec 20 '17 at 00:51
  • @jongivony Maybe. You should have learned how to compute the standard error at some point in your course. Here is one reference from Wikipedia. – angryavian Dec 20 '17 at 00:56
  • I looked through the Wiki but am still not sure how to compute the standard errors.. I'm assuming it's in the expected variance section, and has something to do with the trace operation – jon givony Dec 20 '17 at 01:39