Page 1 of 1

Panel Granger causality

Posted: Sat Jan 31, 2015 7:02 pm
by celineboulenger13
Hi, I am trying to test for Granger causality in panel data with 4 variables (GDP, capital formation, labor, renewable energy use) and I have a panel of 24 countries from 1990 until 2012. I used the code for panelcause and changed some things but my results don't make sense. My variables are cointegrated so I was hoping to find the long term and short term relationship between the variables but all I get is a list of numbers. Here is the code and the results: Could someone help me and tell me what I am doing wrong here? Thanks a lot !!!

dec vect[strings] countries(24)
* Number of lags
*
compute p=3
*
*
* Joint test.
*
sweep(group=%indiv(t),var=hetero)
# ddgdp
# constant ddgdp{1 to p} ddcap{1 to p} ddlab{1 to p} ddre{1 to p}
compute loglunr=%logl,nregunr=%nregsystem
sweep(group=%indiv(t),var=hetero)
# ddgdp
# constant ddgdp{1 to p}
compute loglres=%logl,nregres=%nregsystem
cdf(title="Heterogeneous Panel Causality Test") chisqr 2.0*(loglunr-loglres) nregunr-nregres

Heterogeneous Panel Causality Test
Chi-Squared(216)= 554.432663 with Significance Level 0.00000000
compute jointtest=%cdstat,jointsignif=%signif
*
* Individual causality tests. The individual log likelihood ratios sum
* to the joint test.
*
report(action=define,title="Panel Causality Test")
do i=1,19
linreg(noprint,smpl=%indiv(t)==i) ddgdp
# constant ddgdp{1 to p} ddcap{1 to p} ddlab{1 to p} ddre{1 to p}
exclude(noprint)
# ddcap{1 to p} ddlab{1 to p} ddre{1 to p}
compute lr=log((1+p*%cdstat/%ndf))*%nobs
report(row=new,atcol=1) countries(i) lr %chisqr(lr,p)
end do i
report(row=new,atcol=1) "OVERALL" jointtest jointsignif
report(atcol=2,tocol=2,action=format,picture="*.###")
report(atcol=3,tocol=3,action=format,picture="*.#####")
report(action=show)

14.694 0.00210
2.903 0.40679
37.356 0.00000
17.087 0.00068
4.453 0.21651
12.683 0.00537
3.834 0.27993
8.576 0.03549
11.358 0.00994
5.235 0.15539
6.532 0.08839
4.940 0.17628
10.474 0.01494
22.798 0.00004
2.822 0.41987
4.467 0.21523
4.920 0.17773
6.867 0.07627
19.086 0.00026
OVERALL 554.433 0.00000

Re: Panel Granger causality

Posted: Sun Feb 01, 2015 5:05 am
by TomDoan
You didn't put in your country labels. The program that you are following (panelcause.rpf) had this:

input countries
Austria
Belgium
Denmark
Finland
France
Germany
Iceland
Ireland
Netherlands
Norway
Portugal
Spain
Switzerland
UK
Japan
Australia
New Zealand
Canada
USA

You need to do something similar to get the lines labelled. What this is showing you is the tests for each country (the first number in each line is the statistic, the second is the significance level).

Re: Panel Granger causality

Posted: Sun Feb 01, 2015 1:17 pm
by celineboulenger13
OK I understand the country thing but where does it show me the granger causality tests for all 4 variables? Is it only testing gdp against the next 3 variables?

Thanks for your help!!!

Re: Panel Granger causality

Posted: Sun Feb 01, 2015 3:01 pm
by TomDoan
Yes. That's testing exogeneity of GDP (lack of causality from all three other variables jointly). Exclusion of just one of the four variables isn't a particularly interesting hypothesis.

Re: Panel Granger causality

Posted: Sun Feb 01, 2015 3:47 pm
by celineboulenger13
So what this test tells me is that overall Capital formation, Labor and renewable energy Granger cause GDP?
How can I set it up to where I test for Granger causality running from all variables to all variables? I am trying to see if there is bidirectional causality between GDP and renewable energy consumption.

Thanks!

Re: Panel Granger causality

Posted: Mon Feb 02, 2015 7:51 am
by TomDoan
Just get rid of the DDCAP and DDLAB lags in the unrestricted SWEEP instruction below:

sweep(group=%indiv(t),var=hetero)
# ddgdp
# constant ddgdp{1 to p} ddcap{1 to p} ddlab{1 to p} ddre{1 to p}
compute loglunr=%logl,nregunr=%nregsystem
sweep(group=%indiv(t),var=hetero)
# ddgdp
# constant ddgdp{1 to p}

Do the same in the LINREG and EXCLUDE instructions for the individual tests.

Re: Panel Granger causality

Posted: Tue Feb 03, 2015 4:37 pm
by celineboulenger13
Ok i figured it out for the short run causality but how can I retrieve the long run relationships? The error correction term?

Thanks!

Re: Panel Granger causality

Posted: Tue Feb 03, 2015 5:03 pm
by TomDoan
celineboulenger13 wrote:Ok i figured it out for the short run causality but how can I retrieve the long run relationships? The error correction term?

Thanks!
This is a test for causality. It isn't estimation of a cointegrating vector. The two have little if anything to do with each other. You were doing @PANELFM. That estimates the cointegrating vectors. However, your RE variable clearly isn't going to be in any cointegrating relationship with GDP. A cointegrating relationship is a long-run stable relationship among series which are otherwise non-stationary. How could you possibly estimate that when one of your series is (at least for now) experiencing explosive growth?

Re: Panel Granger causality

Posted: Tue Feb 03, 2015 5:28 pm
by celineboulenger13
I found the problem with my data and the series is I(1) now and no longer explosive. I used @panelfm and got the cointegrating values (after finding cointegration) but I don't understand how @panelfm gives you the ECT term? Isn't it different from the results @panelfm gives you?

Here are my unit root results once I fixed the data:

@ipshin(det=trend, lags=5) re

Im-Pesaran-Shin Unit Root Test: Series RE
Test has large N on large T asymptotics
Null is Unit Root. Alternative is rho(i)<>1 for some i
Individual Specific Components: Constant + Trend

N 23
T 17
P 5
Statistic Signif Level
Z tbar 0.754829 0.774824
Z ttildebar 2.007539 0.977654

Re: Panel Granger causality

Posted: Wed Feb 04, 2015 8:36 am
by TomDoan
@PANELFM (and the other "Pedroni" procedures) are primarily for testing hypotheses regarding cointegration allowing for heterogeneous alternatives. For instance, if you're testing for whether PPP is a stationary relationship, it's possible that PPP will hold for some countries and not others or that if PPP fails, it will fail differently for some countries than others. Hence the desire for heterogeneity. However, they aren't designed for estimating working error correction models. With the amount of data you have, you really can't sensibly estimate heterogeneous error correction models, which, in effect, only use the data from one country at a time.

The example from Pesaran, Shin and Smith(1999), "Pooled Mean Group Estimation of Dynamic Heterogeneous Panels", JASA, vol 94, no. 446, pp 621-634 is one way to handle a more restricted form of error correction model. In that, the cointegrating vector is fixed and everything else is heterogeneous.

Note, by the way, that pretty much everything that you've asked about is covered in the Panel Data e-course.