Arnab Dutta <arnab.killy <at> gmail.com> writes:

> 
> Hi,
> 
>     In order to have robust standard errors in R, what would be the command
> that can generate results similar to the "robust" option in STATA? I tried
> using the "lmrob" command from the package "robustbase". With that, the
> Adjusted R squared is quite different from the normal "lm" command. This
> does not happen in STATA. Can anybody please enlighten me on this?
> 
> -Regards
>  Arnab


  I think you're looking for the sandwich package

example(lm)
library(sandwich)
sqrt(diag(vcov(lm.D9)))
sqrt(diag(vcovHAC(lm.D9)))

(or see example(vcovHAC)

______________________________________________
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.

Reply via email to