Dom Slenk
Dom Slenk

Reputation: 29

Three Dimensional Panel Data: Granger Causality Test in R

I have data which is structured the following: enter image description here

As you can see, I have "multi-dimensional panel data", i.e. I do not only have years and countries, but also industries as a third "index". I did a panel regression analysis with the fixest package to investigate if PE industry (which is a dummy variable) has an impact on employment growth. Moreover, I included several fixed effects in the regression analysis (in this case country-year, industry-year and country-industry).

What I want to do now, is test for granger causality with the pgrangertest formula from the plm package. However, for the panel analysis I did not use the plm package since I was not able to incorporate three indexes (i.e., year, country, industry) and I was not able to incorporate the three fixed interaction effects (i.e., country-year, industry-year and country-industry). This was much easier with the fixest package and the feols formula. This is the formula I used for the regression: feols(Employment Growth ~ PE Industry | Country^Year+Industry^Year+Country^Industry, data = Example)

However, the fixest package does not provide a (panel) Granger causality test formula. Hence, I assume I need to switch to the plm package, but I have no idea how to transfer my formula for the regression to the plm package and hence, how to compute the causality test.

Any ideas - potentially with code examples?

Upvotes: 1

Views: 669

Answers (1)

Helix123
Helix123

Reputation: 3677

The panel Granger non-causality test by Dumitrescu/Hurlin (2012) [1], implemented in pgrangertest of package plm, is really just about two variables (in their original values) in two dimension (observational unit (in your case country) and time period (in your case year)). So, country and year will work. For industry and year you would need some kind of aggregation over industry (e.g., mean per year) if that makes sense for the question at hand. Country, industry, and year at the same time is not possible.

Also, the test does not pick up a user-specified regression model.

pgrangertest uses a formula object to specify the test but it is really just variable_A ~ variable_B.

Example from the help page of the function ?pgrangertest:

library(plm)
data("Grunfeld", package = "plm")
pgrangertest(inv ~ value, data = Grunfeld)
#> 
#>  Panel Granger (Non-)Causality Test (Dumitrescu/Hurlin (2012))
#> 
#> data:  inv ~ value
#> Ztilde = 3.2896, p-value = 0.001003
#> alternative hypothesis: Granger causality for at least one individual

[1] Dumitrescu E, Hurlin C (2012). “Testing for Granger non-causality in heterogeneous panels.” Economic Modelling, 29(4), 1450 - 1460. ISSN 0264-9993, https://www.sciencedirect.com/science/article/pii/S0264999312000491

Upvotes: 1

Related Questions