0

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.

bm1125
  • 135
  • 5
  • Your formula is incorrect: the covariance terms need to be multiplied by the corresponding $x_i.$ – whuber Jan 16 '22 at 18:40
  • Yes that's what I did. I multiplied by variances by 1, 32, 3 respectively – bm1125 Jan 16 '22 at 18:45
  • 1
    You failed to multiply the covariances by the corresponding $x_i,$ though. – whuber Jan 16 '22 at 18:46
  • 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$ – bm1125 Jan 16 '22 at 18:48
  • 2
    See the [formula for the variance of a weighted sum of variables](https://en.wikipedia.org/wiki/Variance#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. – EdM Jan 16 '22 at 21:55

0 Answers0