1

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?

Simon
  • 290
  • 1
  • 11
user144267
  • 55
  • 1
  • 2
  • 8
  • "Coefficients" is plural. What, then, do you mean by a *single* "confidence interval" for them? Do you mean a set of CIs? – whuber Jan 13 '17 at 20:01
  • @whuber : Or maybe an ellipsoid. – Michael Hardy Jan 13 '17 at 20:07
  • 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 – user144267 Jan 13 '17 at 20:23
  • Are you assuming i.i.d. normally distributed errors? The Newey–West method seems to be intended for use with weaker assumptions. – Michael Hardy Jan 13 '17 at 20:36
  • Its a time series analysis, I am expecting autocorrelation and heteroskedacity in the error terms - thats why I am using Newey-West... – user144267 Jan 13 '17 at 20:45

1 Answers1

1

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.

Achim Zeileis
  • 13,510
  • 1
  • 29
  • 53