1
$\begingroup$

I would like to estimate a confidence interval for coefficients of my regression. I calculate the coefficients of the regression with the following code:

library(sandwich)
library(lmtest)
myRegression <- lm(x ~ y)
coeftest(myRegression, vcov = NeweyWest(myRegression, lag = NULL))

And the confidence interval with this code:

confint(Regression, vcov = NeweyWest(myRegression, lag = NULL),level = 0.95)

However, when I try

confint(Regression, level = 0.95)

I get the same confidence interval, although the standard error changes with the Newey West method.

Can someone explain me whether I make a mistake?

$\endgroup$
  • $\begingroup$ "Coefficients" is plural. What, then, do you mean by a single "confidence interval" for them? Do you mean a set of CIs? $\endgroup$ – whuber Jan 13 '17 at 20:01
  • $\begingroup$ @whuber : Or maybe an ellipsoid. $\endgroup$ – Michael Hardy Jan 13 '17 at 20:07
  • $\begingroup$ Sorry for being not precise. I have a multiple regression with several coefficients. For each one of them I would like to calculate an CI $\endgroup$ – user144267 Jan 13 '17 at 20:23
  • $\begingroup$ Are you assuming i.i.d. normally distributed errors? The Newey–West method seems to be intended for use with weaker assumptions. $\endgroup$ – Michael Hardy Jan 13 '17 at 20:36
  • $\begingroup$ Its a time series analysis, I am expecting autocorrelation and heteroskedacity in the error terms - thats why I am using Newey-West... $\endgroup$ – user144267 Jan 13 '17 at 20:45
1
$\begingroup$

The confint() method does not allow to plug in vcov arguments. Therefore such the function coefci() has been added to lmtest (starting from version 0.9-35). The default coefci(Regression) yields the same as confint(Regression). However, you can also do coefci(Regression, vcov = NeweyWest). This should give what you are looking for.

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.