1
$\begingroup$

In simple linear regression, I know the confidence interval can be calculated from:

$CI = t\sqrt{\frac{\sigma^2}{n}+\frac{(x-\bar{x})^2\sigma^2}{\sum{(x-\bar{x})^2}}}$

I know this equation comes from the relation $Y=\bar{Y} +\beta_1(x-\bar{x})$

Is there a way to either use Matrix Algebra to calculate this from the Standard Error matrix?

$\sigma^2(X'X)^{-1}$ where $\sigma^2 = \frac{SS_e}{\nu}$ and degrees of freedom $\nu = n-2$

I'm looking for a way to extend the confidence interval to multiple linear regression, including polynomial x.

$\endgroup$
  • $\begingroup$ Didn't you find anything when searching our site? Try multiple regression confidence interval $\endgroup$ – whuber Aug 17 '16 at 14:45
  • $\begingroup$ I see lots of R code, but no generalizations. $\endgroup$ – Kevin Nowaczyk Aug 17 '16 at 14:53
  • 1
    $\begingroup$ Here's the closest I could come in my search: Rob Hyndman's formula for a prediction interval at stats.stackexchange.com/a/9144/919. A value of $1$ is mysteriously added in--that accounts for the prediction uncertainty. If you were to leave that out, you would have a confidence interval. For details, consult any textbook on multiple regression. $\endgroup$ – whuber Aug 17 '16 at 14:56
  • $\begingroup$ It's not mysterious, the prediction interval has an extra 1 to account for the fact the we are predicting future values of $Y$, vs the value of $\hat{Y}$ in the confidence interval. Something like: $V(Y) = V(\hat{Y}) + \sigma^2$ $\endgroup$ – Kevin Nowaczyk Aug 17 '16 at 15:15
  • 1
    $\begingroup$ Isn't that what I wrote? :-) But since you clearly understand that point, you will be able to use Hyndman's post effectively. $\endgroup$ – whuber Aug 17 '16 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.