2

I have been estimating a panel VAR model via GMM (Generalized Method of Moments) over ~20k observations with the panelvar R package by Sigmund and Ferstl.

However, I was surprised that there is no function provided to test for granger causality. Is it because the test needs to be implemented with the help of another function? I saw that the Stata package pvar (which serves a similar purpose) provides the function pvargranger (so it seems common to provide the test).

Update: The question was created because the STATA implementation provides the Granger causality function. However, the computation is independent from GMM PVARs (see Dumitrescu, E. I., & Hurlin, C. (2012). Testing for Granger non-causality in heterogeneous panels. Economic modelling, 29(4), 1450-1460. - on p.1451 the authors compare Granger causality to PanelVAR), so that the best solution is to use the plm package as Helix123 pointed out!

Simon Stolz
  • 207
  • 2
  • 7
  • Have you tried to impliment xtgcause command? Have a look at https://econpapers.repec.org/paper/irnwpaper/17-03.htm and https://www.statalist.org/forums/forum/general-stata-discussion/general/1443965-granger-causality-using-panel-data. – Cenk May 20 '20 at 16:21
  • 2
    If you are looking for a R implementation of the (ordinary) Granger test, there is function `grangertest` in package `lmtest`. The panel Granger test by Dumitrescu/Hurlin is implemented in `pgrangertest` of package `plm`. – Helix123 May 22 '20 at 08:32
  • I am impressed that you could use "panelvar" with 20k observations. I have about 5000 and keep getting "Cholmod error 'problem too large". Apparently, that also happened with others: https://community.rstudio.com/t/r-memory-problem-with-panelvar-package/12738. @Simon, could you share your code using pvargmm? How did you address this issue? – Miranda Oct 19 '20 at 23:40
  • 1
    Hi @Miranda! Yes, I also had the issue with panelvar's speed. While I did not receive an error, it was very slow. The authors of the package kindly answered my question and suggested to attempt setting `collapse = TRUE`. An additional computational problem is possibly the Windmijer correction, which is only active with the two-step procedure. I'd suggest to attempt if this helps, and see if it is permittable in your case. I found Roodman's "A Note on the Theme of Too Many Instruments" helpful to better understand these parameters. – Simon Stolz Oct 21 '20 at 15:42

0 Answers0