Page 1 of 1

Granger Causality Tests with Panel Data

PostPosted: Tue May 29, 2012 5:48 pm
by e1983
Hi. I was curious if someone could point me to an example or discussion regarding the granger causality tests in panel data?

Re: Granger Causality Tests with Panel Data

PostPosted: Wed May 30, 2012 10:26 am
by TomDoan
e1983 wrote:Hi. I was curious if someone could point me to an example or discussion regarding the granger causality tests in panel data?


Holtz-Eakin, Newey and Rosen (http://www.estima.com/forum/viewtopic.php?f=31&t=616) mention the possibility of Granger causality tests in their panel VAR methodology. Since they are doing (very) small T-large N data sets, the lag coefficients are homogeneous across individuals (only the intercepts vary) so the test is the rather obvious Wald test on the lag coefficients.

For the more typical situation where you might do a causality test (macro data), the N will be quite a bit smaller and T much larger. Assuming a homogeneous VAR probably makes little sense in those situations. I've seen a few papers which allowed heterogeneity in the "other" lags (the ones being tested) while imposing homogeneity on the own lags and on the residual variances. To me, that makes little sense. Under the alternative that the "others" are non-zero, there is no reason to expect the own lags to be the same across individuals---they're reduced form parameters, not structural. Allowing everything to be heterogeneous, the joint LR test on the lags is actually just the sum of individual LR tests. The attached program (which uses the data set from the Mark & Sul 2003 paper) does both the individual and joint tests for the growth in real money causing growth in real income:

panelcause.rpf
Program file
(1.45 KiB) Downloaded 286 times

moneydemand.rpf
Data file
(2.83 KiB) Downloaded 201 times

Re: Granger Causality Tests with Panel Data

PostPosted: Fri Jun 01, 2012 8:32 pm
by e1983
Thanks so much for the response and programs. It greatly helped.

Re: Granger Causality Tests with Panel Data

PostPosted: Tue Jul 10, 2012 10:31 pm
by guo
Dear

Thank you so much for your precious time and attention.

Concerning the panel causality test, I wrote the program, and there are some problems in running it:
Code: Select all
OPEN DATA "D:\Electro New\panel rearragment 2012-7-8.xlsx"
CALENDAR(M) 2003:2
DATA(FORMAT=XLSX,ORG=COLUMNS,right=100) 2003:02 2012:04
pform x
# individual_1 to individual_96
calendar(m,panel=2012:3) 2003:2
all 96//2012:3
pform(repeat) p_new
# p
pform(repeat) n_new
# n
*Panel causallity analysis
dec vec[string] individual(2)
input individual(2)
individual_1
individual_2

* Number of lags
com p=3

* Joint test.
*
sweep(group=%indiv(t),var=hetero)
# x
# constant x{1 to p} p{1 to p}  n{1 to p}
compute loglunr=%logl,nregunr=%nregsystem
sweep(group=%indiv(t),var=hetero)
# x
# constant x{1 to p}
compute loglres=%logl,nregres=%nregsystem
cdf(title="Heterogeneous Panel Causality Test") chisqr 2.0*(loglunr-loglres) nregunr-nregres
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,96
   linreg(noprint,smpl=%indiv(t)==i) x
   # constant x{1 to p} p{1 to p} n{1 to p}
   exclude(noprint)
   # p{1 to p} n{1 to p}

   compute lr=log((1+p*%cdstat/%ndf))*%nobs
   report(row=new,atcol=1) individual_1 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)


My questions is:

I want to get the panel causality results for short-term and long-term for X, P and N, how can I revise the program?

Thank you very much.

Best Regards

guo

Re: Granger Causality Tests with Panel Data

PostPosted: Wed Jul 11, 2012 10:08 am
by TomDoan
You have a very simple test for long-run non-causality---your data aren't I(1), therefore they aren't cointegrated, therefore there is no long-run causality. The "short-run" causality would be tested as described earlier in the thread.

Re: Granger Causality Tests with Panel Data

PostPosted: Sun Jul 15, 2012 12:54 am
by guo
Dear Tom,

Thank you very much for all of your help.

Concerning Panel Granger Causality Test, the first step is to estimate the long-run equilibrium relations: Xit=Ai+DELTAit+GAMA1i*P+GAMA2i*N+Uit

Here is my question:

For panel data, if I want to get the first step: long-run residual, shall I use
Code: Select all
pregress(method=random) commodity / resids
# constant p n

or
Code: Select all
lin(define=spread) commodity / resids
# constant p n


Thank you so much for your always kind suggestion.

Best Regards

guo

Re: Granger Causality Tests with Panel Data

PostPosted: Sun Jul 15, 2012 11:42 am
by TomDoan
If your data aren't I(1), there is no long-run equilibrium relationship to estimate; there is no long-run causality. There is no need to test further for it, in fact, the test will give a misleading result when applied to stationary data.

Re: Granger Causality Tests with Panel Data

PostPosted: Sun Jul 15, 2012 7:29 pm
by guo
Dear e1983,

Thank you so much for your kind reply.

Right now I use level data, and they are I(1). So I applied panel VECM to them.

Based on this condition, when I want to get long term equilibrium, which syntax I should use: "Linreg" or "Pregress" ?

I am very looking forward to your suggestion.

Best Regards

guo

Re: Granger Causality Tests with Panel Data

PostPosted: Sun Jul 15, 2012 8:20 pm
by moderator
You would use PREGRESS to take care of the individual effects. However, you wouldn't use METHOD=RANDOM. Use fixed effects instead.

Re: Granger Causality Tests with Panel Data

PostPosted: Mon Jul 16, 2012 2:13 am
by guo
Dear all,

Thank you so much for all of your kind help.

I greatly appreciate that.

Best Regards

guo