I'm currently trying to use Newey-West standard errors accounting for Heteroskedasticity and Autocorrelation with the sandwich package in R, but i lack understanding as i can not fully grasp the instructions provided in the manual.


## fit investment equation
fm <- lm(RealInv ~ RealGNP + RealInt, data = Investment)
## Newey & West (1994)  (Heteroskedasticity and Autocorrelationconsistent; HAC) 
## Covariance Matrix Estimation
## The Newey & West (1987) estimator requires specification
## of the lag and suppression of prewhitening
NeweyWest(fm, lag = 4, prewhite = FALSE)

Unfortunately that's all the information the authors provide. I understand that it is only the estimated HAC Variance-Covariance Matrix but how do you proceed from there to obtain valid standard errors and t-statistics? And is my assumption correct that if you don't specify the lag, the bwNeweyWest function automatically selects the number of relevant lags?

  • 1
    $\begingroup$ Edit: I was able to use the lmtest package with the coeftest function where you can just choose which VCV-Matrix you would like to perform the Coefficient tests. $\endgroup$
    – Gritti
    Jul 17, 2014 at 10:11


Browse other questions tagged or ask your own question.