[R] HAC corrected standard errors

Shruthi Jayaram shruthi.jayaram.85 at gmail.com
Tue Mar 10 09:55:25 CET 2009


Hi,

I have a simple linear regression for which I want to obtain HAC corrected
standard errors, since I have significant serial/auto correlation in my
residuals, and also potential heteroskedasticity.

Would anyone be able to direct me to the function that implements this in R?
It's a basic question and I'm sure I'm missing something obvious here. I
looked up this post:

http://www.nabble.com/Re%3A-Moving-Window-regressions-with-corrections-for-Heteroscedasticity-and-Autocorrelations(HAC)-td6075371.html#a6075371

which recommended that I use the coeftest() function in package lmtest, but
when I tried to assign an object:

result <- coeftest(regre, NeweyWest), where regre is an object of class lm,
this returned an error. 

I'd be grateful for any advice, since I'm sure I'm making one of those
simple bloopers.

Thanks!

Shruthi
-- 
View this message in context: http://www.nabble.com/HAC-corrected-standard-errors-tp22430163p22430163.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list