[R] VAR with HAC
Pfaff, Bernhard Dr.
Bernhard_Pfaff at fra.invesco.com
Thu Feb 17 10:31:51 CET 2011
Hello Marta,
have you read ?coeftest and ? VAR carefully enough? The function does expect a lm/glm object for x as argument. Hence, the following does work:
library(vars)
data(Canada)
myvar <- VAR(Canada, p = 2, type = "const")
lapply(myvar$varresult, coeftest)
Best,
Bernhard
> -----Ursprüngliche Nachricht-----
> Von: r-help-bounces at r-project.org
> [mailto:r-help-bounces at r-project.org] Im Auftrag von Marta Lachowska
> Gesendet: Mittwoch, 16. Februar 2011 16:50
> An: r-help at r-project.org
> Betreff: [R] VAR with HAC
>
>
> Hello,
> I would like to estimate a VAR model with HAC corrected
> standard errors. I tried to do this by using the sandwich
> package, for example:
>
> > library(vars)
> > data(Canada)
> > myvar = VAR(Canada, p = 2, type = "const") coeftest(myvar, vcov =
> > vcovHAC)
> Error in umat - res : non-conformable arrays
>
> Which suggests that this function is not compatible with the
> VAR command. Has anyone tried to modify the code to get HAC
> corrected standard errors with VAR? Any suggestions are welcome.
>
> Thank you.
>
> Marta
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.
>
*****************************************************************
Confidentiality Note: The information contained in this ...{{dropped:10}}
More information about the R-help
mailing list