0
$\begingroup$

Say I have a regression model as follows:

$\ \hat{y}_i = \hat\beta_0 + \hat\beta_1x_1 + \hat\beta_2x_2, n = 79$

and I have the following covariance matrix

$\ \begin{bmatrix} intercept & 6.5949972 & -0.194885084 & -0.350537852 \\ x_1 & -0.1948851 & 0.006067346 & 0.006432345 \\ x_2 & -0.3505379 & 0.006432345 & 0.078783756 \end{bmatrix} $

and I want to compute confidence interval for a following vector of values $\ (1, x_1, x_2) = (1, 32, 3) $

so to compute the variance of the expectation estimator I tried

$\ var(\hat{Y_i}) = var(\hat\beta_0 + \hat\beta_1 x_1 + \hat\beta_2 x_2 ) = var(\hat\beta_0) + 32^2 var(\hat\beta_1) + 3^2 var(\hat\beta_2) + 2 cov(\hat\beta_0,\hat\beta_1) + 2cov(\hat\beta_0,\hat\beta_1) + 2cov(\hat\beta_1,\hat\beta_2)$

and then taking square root and multiplying by t critic but my answer is far off. I get $\ s_{\hat y} = \sqrt{12.20473} $ and it is far off.

$\endgroup$
5
  • $\begingroup$ Your formula is incorrect: the covariance terms need to be multiplied by the corresponding $x_i.$ $\endgroup$
    – whuber
    Commented Jan 16, 2022 at 18:40
  • $\begingroup$ Yes that's what I did. I multiplied by variances by 1, 32, 3 respectively $\endgroup$
    – bm1125
    Commented Jan 16, 2022 at 18:45
  • 1
    $\begingroup$ You failed to multiply the covariances by the corresponding $x_i,$ though. $\endgroup$
    – whuber
    Commented Jan 16, 2022 at 18:46
  • $\begingroup$ Here's the approx caculation i've done $\ 6.59 + 32^2*0.006 + 3^2 * 0.078 + 2 * -0.19 + 2 * -0.35 + 2 * 0.07 = 12.49$ $\endgroup$
    – bm1125
    Commented Jan 16, 2022 at 18:48
  • 2
    $\begingroup$ See the formula for the variance of a weighted sum of variables. As @whuber notes, similarly to how you must square the weights for the variance terms, you must multiply each covariance term by the product of the two weights involved. $\endgroup$
    – EdM
    Commented Jan 16, 2022 at 21:55

0