Susan Chen
2009-Jun-26 20:11 UTC
[R] Heteroskedasticity and Autocorrelation in SemiPar package
Hi all, 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) Any suggestion would be greatly appreciated. Thanks, Susan [[alternative HTML version deleted]]
Liviu Andronic
2009-Jun-26 21:05 UTC
[R] Heteroskedasticity and Autocorrelation in SemiPar package
On Fri, Jun 26, 2009 at 10:11 PM, Susan Chen<suenb16 at 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