On Fri, Jun 26, 2009 at 10:11 PM, Susan Chen<suen...@yahoo.com> wrote:
> Does anyone know how to report heteroskedasticity and 
> autocorrelation-consistent standard errors when using the "spm" command in 
> SemiPar package? Suppose the original command is
> sp1<-spm(y~x1+x2+f(x3), random=~1,group=id)
>
There's HAC() in library(gmm), which is a modification from the
sandwich::vcovHAC(), designed to accept as input any vectors (and not
only specific objects, such as lm).

The sandwich::vcovHAC() can also be relatively easily extended to
accept other fits as input (not only lm or glm, for example), but this
would require some understanding of the internals of both SemiPar and
sandwich. You might enquire if the author of SemiPar is interested in
adding such functionality. For technical details, check the first
vignette of sandwich.

Once you get HAC covariance matrix for your fit, you can use either
lmtest::coeftest or library(car) to obtain the HAC std errs.
Liviu

______________________________________________
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