Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Granger causality using panel data

    Dear users,

    I am using Stata 15 and I have an unbalanced panel data set with time indicated by variable -year- and firms identified by -id-. Moreover, as shown below, my data set contains two variables -CSP_t_s_w- and -lag_IO_w-. Using Granger causality, I would like to test the for causality between the variables (both directions).

    My dataet contains 23,097 observations and 3,077 panels.

    I tried using -xtgcause-


    However, the following occurs:

    Code:
    . set matsize 11000
    
    . xtgcause CSP_t_s_w lag_IO_w, lags(1)
    no observations
    r(2000);

    Does anyone know what I wrong? And anybody known how I can run a successful Granger causality test?

    Thank you in advance.


    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float year long id byte CSP_t_s_w float lag_IO_w
    2000  1  1 .10273538
    2001  1  2  .4753718
    2002  1 11 .57919884
    2003  1  8  .6090328
    2004  1  9  .6398019
    2005  1 12  .7047455
    2006  1 12  .6007842
    2007  1 12  .7196747
    2008  1 12  .8020943
    2009  1 12  .7530805
    2010  1 11  .7809083
    2011  1 10  .7956449
    2012  1  4  .7915173
    2005  3  0  .1929813
    2006  3  1  .3637863
    2007  3  1  .4739601
    2008  3  1 .52113575
    2009  3  1  .5178801
    2010  3  0  .4741296
    2011  3  0  .4554001
    2012  3  0  .4432893
    2003  5  0  .4057413
    2004  5  2  .6909133
    2005  5  2  .7740778
    2006  5  2  .9303825
    2009  5  2  .8186493
    2010  5  0  .8578832
    2003  7  1   .376464
    2004  7  1  .3819983
    2005  7  0   .445843
    2006  7  0  .4561931
    2007  7  0 .53831077
    2008  7  0 .52190083
    2009  7  0 .58483595
    2010  7  0  .6472263
    2011  7  0 .59393615
    2012  7  0  .6134479
    2002  8  1 .08887848
    2003  8  0  .7499226
    2004  8  0  .9177671
    2005  8  0  .9694591
    2006  8  0   .944322
    2007  8  0  .8915893
    2008  8  0   .935876
    2009  8  0  .9408627
    2010  8  1  .9994474
    2011  8  1  .9193724
    2012  8  0  .9837171
    1991  9  5  .6455355
    1992  9  6  .6606081
    1993  9  6   .608819
    1994  9  6  .4412391
    1995  9  6 .51127815
    1996  9  5  .3906025
    1997  9  5   .442698
    1998  9  3 .25791878
    1999  9  4   .638057
    2000  9  3  .6750889
    2001  9  2  .4281542
    2002  9  3  .5414144
    2003  9  2  .6030415
    2004  9  2  .6430176
    2005  9  4  .7083326
    2006  9  4  .7252894
    2007  9  5  .7247008
    2008  9  4  .6766716
    2009  9  4  .6793423
    2010  9  8  .7151029
    2011  9  7  .6948657
    2012  9  6  .6775908
    2006 10  0   .276984
    2007 10  0  .5215995
    2008 10  0  .9288951
    2009 10  0  .7196317
    2010 10  0  .6809544
    2007 12  0  .9596174
    2009 12  0  .9458403
    2011 12  0  .9803602
    2009 13  1  .2162916
    2010 13  0  .3018089
    2004 14  1  .3291313
    2005 14  0  .5344354
    2006 14  1 .53080064
    2007 14  1  .7165132
    2008 14  1  .8001877
    2009 14  1  .9331361
    2010 14  0  .8769743
    2011 14  0  .8963494
    2012 14  2  .9074407
    2006 15  4 .08887848
    2007 15  4  .1131506
    2008 15  4  .5344937
    2009 15  4  .5535941
    2010 15  0 .52943635
    2002 16  0   .873021
    2003 16  1  .8825788
    2004 16  1   .838463
    2006 16  1  .9327447
    2007 16  1  .9886779
    2008 16  1  .9203752
    end
    label values id id2
    label def id2 1 "A", modify
    label def id2 3 "AACC", modify
    label def id2 5 "AAI", modify
    label def id2 7 "AAON", modify
    label def id2 8 "AAP", modify
    label def id2 9 "AAPL", modify
    label def id2 10 "AATI", modify
    label def id2 12 "AAWW", modify
    label def id2 13 "ABAT", modify
    label def id2 14 "ABAX", modify
    label def id2 15 "ABBC", modify
    label def id2 16 "ABC", modify




  • #2
    Hi, Ralph: I guess that -xtgcause- command requires balanced panel data. Please first (ssc) install xtbalance, and try the following:
    Code:
    xtset id year
    xtbalance, range(2000 2012) miss( CSP_t_s_w lag_IO_w)
    xtgcause CSP_t_s_w lag_IO_w, lags(1)
    The result is:
    Code:
    Dumitrescu & Hurlin (2012) Granger non-causality test results:
    --------------------------------------------------------------
    Lag order: 1
    W-bar =          0.3600
    Z-bar =         -0.6400   (p-value = 0.5222)
    Z-bar tilde =   -0.5692   (p-value = 0.5692)
    --------------------------------------------------------------
    H0: lag_IO_w does not Granger-cause CSP_t_s_w.
    H1: lag_IO_w does Granger-cause CSP_t_s_w for at least one panelvar (id).
    Ho-Chuan (River) Huang
    Stata 19.0, MP(4)

    Comment


    • #3
      Dear River, thank you for response,

      However, I case I use (my data set runs from 1991-2012):

      Code:
      xtbalance, range(1991 2012) miss( CSP_t_s_w lag_IO_w)
      19,929 out of 23,097 observations are deleted due to discontinues.

      Moreover, the result does not show any values:

      Code:
      Dumitrescu & Hurlin (2012) Granger non-causality test results:
      --------------------------------------------------------------
      Lag order: 1
      W-bar =               .
      Z-bar =               .   (p-value =     .)
      Z-bar tilde =         .   (p-value =     .)
      --------------------------------------------------------------
      H0: lag_IO_w does not Granger-cause CSP_t_s_w.
      H1: lag_IO_w does Granger-cause CSP_t_s_w for at least one panelvar (id).
      
      .
      Do you happen to know a solution to this issue? Maybe another procedure?

      Again, thank you for the helpful input.

      Comment


      • #4
        Hi, Ralph, Then you may want to change, say
        Code:
        range(2000 2012)
        Ho-Chuan (River) Huang
        Stata 19.0, MP(4)

        Comment


        • #5
          Hello River,

          Thank you for the reaction.

          To be honest, I do not think it really makes a difference.

          I get the following output from Stata:

          Code:
          . xtbalance, range(2000 2012) miss( CSP_t_s_w lag_IO_w)
          
          (2566 observations deleted due to out of range)
          
          (17424 observations deleted due to discontinues)
          
          .
          
          
          . xtgcause CSP_t_s_w lag_IO_w, lags(1)
          
          
          Dumitrescu & Hurlin (2012) Granger non-causality test results:
          --------------------------------------------------------------
          Lag order: 1
          W-bar =               .
          Z-bar =               .   (p-value =     .)
          Z-bar tilde =         .   (p-value =     .)
          --------------------------------------------------------------
          H0: lag_IO_w does not Granger-cause CSP_t_s_w.
          H1: lag_IO_w does Granger-cause CSP_t_s_w for at least one panelvar (id).

          Comment


          • #6
            Is there any other way I can perform a Granger causality test on unbalanced panel data?

            I have seen it done in papers that do research following similar methodologies and using similar data such as Dyck et al. (2017):


            Reference: Dyck, A., K.V. Lins, L. Roth and H.F. Wagner (2017) ‘Do Institutional Investors Drive Corporate Social Responsibility? International Evidence’, Journal of Financial Economics, forthcoming Available at: https://papers.ssrn.com/sol3/papers....act_id=2708589

            Comment


            • #7
              Hello everyone,

              Since I have not received any more response, I would like to try it once more. Hopefully someone knows the answer.

              Is there a function/command in Stata that allows me to perform a Granger causality test on the unbalanced panel data set above?

              Thank you all in advance.

              Best regards

              Comment


              • #8
                Hello Ralph,
                I have exactly the same problem as you. When I perform xtcause, nothing appears (empty table). Please let me know if you have found any solution.
                Best regards,

                Comment


                • #9
                  hello River, I have more or less the same issue of an unbalanced data panel. I have two questions if you might please consider answer. 1) I want to use xtgcause for two variables ( productivity in log terms, and export in log terms ) but i get (134) problem in stata for too many values...2) What to do if when xtbalance I loose all the observations?

                  Comment


                  • #10
                    Dear all,

                    I have the same problem as Ralph and Nathalie. Have you found any solution?
                    Please let me know.
                    Best regards,
                    Katharina

                    Comment


                    • #11
                      Hello all,
                      I have the same problem as well with xtgcause with empty table, does anyone a solution?
                      Best Regards,

                      Comment


                      • #12
                        Dear All,

                        As of yet there is no simple way of running a granger causality test when the data set is unbalanced in Stata, the best you can do is to "force" the data to be balanced, however one should be careful when doing this as it may result in the P-value being wrong and your work being rejected. I would suggest that the best approach is to simply restrict the sample to only include those observations that have data available over the whole period.

                        Kind regards,
                        Jordan

                        Comment


                        • #13
                          Dear all,
                          Can i apply the Granger causality test after panel data models? as my panel is stationary at level. So can i apply this command "xtgcause" after FE and GMM?

                          Comment


                          • #14
                            because usually Granger causality test are applicable after co-integration test.


                            Regards
                            Rabia

                            Comment


                            • #15
                              Dear all, my panel data set is strongly balanced. I wanted to carry out Granger causality test to find out directions for my variables. Stata shows "command xtgcause is unrecognized" when I tried the command. I need help to identify and learn my mistakes. TIA

                              Comment

                              Working...
                              X