Wednesday, November 7, 2012

Granger Causality Testing in R

Today just gets better and better!

I had an email this morning from Christoph Pfeiffer, who follows this blog. Christoph has put together some nice R code that implements the Toda-Yamamoto method for testing for Granger causality in the context of non-stationary time-series data.

Given the ongoing interest in the various posts I have had (here, here, here & here) on testing for Granger causality, I'm sure that Christoph's code will be of great interest to a lot of readers.

Thanks for sharing this with us, Christoph.


© 2012, David E. Giles

2 comments:

  1. For what it's worth, it easier and more flexible to carry out the analysis in R using the VAR package and its causality tests. The EViews analysis can be matched exactly by using exogen option for the lag 7 variables. The only tricky bit is making sure that a proper matching sample is used. When the bootstrapping or voc.=vcovHC options are used, Granger causality is rejected for both variables at any reasonable significance level.

    ReplyDelete