Thank you for your hint!

I see that there was a thread discussing implementation of what I
wanted to do (Newey-West standard errors in a VAR context), but that
there is a conflict due to how the type = "const" is defined in the VAR
command: https://stat.ethz.ch/pipermail/r-sig-finance/2009q2/004272.html
that appears not to be resolved. 
 
Best, 
 
Marta
 

>>> "Pfaff, Bernhard Dr." <bernhard_pf...@fra.invesco.com> 2/17/2011
4:31 AM >>>
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-boun...@r-project.org 
> [mailto:r-help-boun...@r-project.org] Im Auftrag von Marta Lachowska
> Gesendet: Mittwoch, 16. Februar 2011 16:50
> An: r-help@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@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:14}}

______________________________________________
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