sandwich package is what you want. Best
2009/3/10 Shruthi Jayaram <shruthi.jayaram...@gmail.com>: > > 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. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- HUANG Ronggui, Wincent Tel: (00852) 3442 3832 PhD Candidate Dept of Public and Social Administration City University of Hong Kong Home page: http://asrr.r-forge.r-project.org/rghuang.html A sociologist is someone who, when a beautiful women enters the room and everybody look at her, looks at everybody. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.