Announcement

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

  • Problem in addressing missing value and no p-value generated from xtgcause

    I have an industry level panel data with 9 firms and 64 time variables (2002-2017 quarterly).
    The problem with my dataset is that there are quite a lot of missing values in both dependent (return on assets, earnings per share) and independent variables (long term debt, short term debt, total equity, firm size).

    co is the company name
    t is the time
    roa - return on asset
    eps - earnings per share
    ltd - long term debt
    std - short term debt
    te - total equity

    . dataex co date roa eps ltd std te fsize
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input byte co int date double(roa eps ltd std te fsize)
    1 168  -1.59    -.3 .150732123 .480732368 -.150451912 6.864904853
    1 169  -1.59    -.3 .150732123 .480732368 -.150451912 6.864904853
    1 170  -2.33   -.33 .150210285 .458963326 -.194214293 6.872869911
    1 171  -2.33   -.33 .150210285 .458963326 -.194214293 6.872869911
    1 172  -2.33   -.33 .150210285 .458963326 -.194214293 6.872869911
    1 173  -2.33   -.33 .150210285 .458963326 -.194214293 6.872869911
    1 174  -4.23   -.44 .190369006 .520745457 -.705290641 6.793188379
    1 175  -4.23   -.44 .190369006 .520745457 -.705290641 6.793188379
    1 176  -4.23   -.44 .190369006 .520745457 -.705290641 6.793188379
    1 177  -4.23   -.44 .190369006 .520745457 -.705290641 6.793188379
    1 178  19.49    .36 .217024206 .380363482 -.674301913 6.757220909
    1 179  19.49    .36 .217024206 .380363482 -.674301913 6.757220909
    1 180  19.49    .36 .217024206 .380363482 -.674301913 6.757220909
    1 181  19.49    .36 .217024206 .380363482 -.674301913 6.757220909
    1 182   3.97   -.08 .001139766 .622463703 -.740918166 6.739064501
    1 183   3.97   -.08 .001139766 .622463703 -.740918166 6.739064501
    1 184   3.97   -.08 .001139766 .622463703 -.740918166 6.739064501
    1 185   3.97   -.08 .001139766 .622463703 -.740918166 6.739064501
    1 186  87.44   1.87          0 .330706019   .08328106 6.724594918
    1 187  87.44   1.87          0 .330706019   .08328106 6.724594918
    1 188  87.44   1.87          0 .330706019   .08328106 6.724594918
    1 189  87.44   1.87          0 .330706019   .08328106 6.724594918
    1 190   3.54    .01          0 .311766926  .100444915 6.695879189
    1 191   3.54    .01          0 .311766926  .100444915 6.695879189
    1 192   3.54    .01          0 .311766926  .100444915 6.695879189
    1 193   3.54    .01          0 .311766926  .100444915 6.695879189
    1 194  -4.62   -.12          0 .339366645  .011952315 6.659040076
    1 195  -4.62   -.12          0 .339366645  .011952315 6.659040076
    1 196  -4.62   -.12          0 .339366645  .011952315 6.659040076
    1 197  -4.62   -.12          0 .339366645  .011952315 6.659040076
    1 198  44.19    .82          0          0  .443169288 6.631867709
    1 199  44.19    .82          0          0  .443169288 6.631867709
    1 200  44.19    .82          0          0  .443169288 6.631867709
    1 201  44.19    .82          0          0  .443169288 6.631867709
    1 202   6.19    .11          0          0  .469977361 6.637428884
    1 203   6.19    .11          0          0  .469977361 6.637428884
    1 204   6.19    .11          0          0  .469977361 6.637428884
    1 205   6.19    .11          0          0  .469977361 6.637428884
    1 206   2.15    .04          0          0  .513438257 6.638185144
    1 207   2.15    .04          0          0  .513438257 6.638185144
    1 208   2.15    .04          0          0  .513438257 6.638185144
    1 209   2.15    .04          0          0  .513438257 6.638185144
    1 210  15.81    .31          0          0  .592651551 6.686776543
    1 211  15.81    .31          0          0  .592651551 6.686776543
    1 212  15.81    .31          0          0  .592651551 6.686776543
    1 213  15.81    .31          0          0  .592651551 6.686776543
    1 214   4.38   .089          0          0   .64532583 6.683586418
    1 215   4.38   .089          0          0   .64532583 6.683586418
    1 216   4.38   .089          0          0   .64532583 6.683586418
    1 217   4.38   .089          0          0   .64532583 6.683586418
    1 218  -5.65  -.111          0          0  .615601448  6.64943933
    1 219  -5.65  -.111          0          0  .615601448  6.64943933
    1 220  -5.65  -.111          0          0  .615601448  6.64943933
    1 221  -5.65  -.111          0          0  .615601448  6.64943933
    1 222      .      .          .          .           .           .
    1 223      .      .          .          .           .           .
    1 224      .      .          .          .           .           .
    1 225      .      .          .          .           .           .
    1 226      .   .008          0          0  .813225686 6.950537418
    1 227      .   .008          0          0  .813225686 6.950537418
    1 228      .   .008          0          0  .813225686 6.950537418
    1 229      .   .008          0          0  .813225686 6.950537418
    1 230      .   .008          0          0  .813225686 6.950537418
    1 231      .   .008          0          0  .813225686 6.950537418
    2 168  -1.84   -.93          0 .344851369  .499351248 5.666488028
    2 169  -1.84   -.93          0 .344851369  .499351248 5.666488028
    2 170  -1.84   -.93          0 .344851369  .499351248 5.666488028
    2 171  -1.84   -.93          0 .344851369  .499351248 5.666488028
    2 172   -6.5  -1.68          0 .350226662  .405998069 5.659770777
    2 173   -6.5  -1.68          0 .350226662  .405998069 5.659770777
    2 174   -6.5  -1.68          0 .350226662  .405998069 5.659770777
    2 175   -6.5  -1.68          0 .350226662  .405998069 5.659770777
    2 176   5.87    .62          0 .393167866  .568534776 5.551550021
    2 177   5.87    .62          0 .393167866  .568534776 5.551550021
    2 178   5.87    .62          0 .393167866  .568534776 5.551550021
    2 179   5.87    .62          0 .393167866  .568534776 5.551550021
    2 180   1.34    .07          0  .32118577  .614080427 5.526667459
    2 181   1.34    .07          0  .32118577  .614080427 5.526667459
    2 182   1.34    .07          0  .32118577  .614080427 5.526667459
    2 183   1.34    .07          0  .32118577  .614080427 5.526667459
    2 184  -6.59 -1.222          0 .329335334  .582746206 5.550547534
    2 185  -6.59 -1.222          0 .329335334  .582746206 5.550547534
    2 186  -6.59 -1.222          0 .329335334  .582746206 5.550547534
    2 187  -6.59 -1.222          0 .329335334  .582746206 5.550547534
    2 188 118.27 36.613          0          0  .865657679 6.133425849
    2 189 118.27 36.613          0          0  .865657679 6.133425849
    2 190 118.27 36.613          0          0  .865657679 6.133425849
    2 191 118.27 36.613          0          0  .865657679 6.133425849
    2 192  35.35 15.561          0 .046796937  .752900006 6.028752578
    2 193  35.35 15.561          0 .046796937  .752900006 6.028752578
    2 194  35.35 15.561          0 .046796937  .752900006 6.028752578
    2 195  35.35 15.561          0 .046796937  .752900006 6.028752578
    2 196  27.52  7.932          0          0  .953999731 5.717179356
    2 197  27.52  7.932          0          0  .953999731 5.717179356
    2 198  27.52  7.932          0          0  .953999731 5.717179356
    2 199  27.52  7.932          0          0  .953999731 5.717179356
    2 200   6.66   1.05          0          0   .94722756 5.537186705
    2 201   6.66   1.05          0          0   .94722756 5.537186705
    2 202   6.66   1.05          0          0   .94722756 5.537186705
    2 203   6.66   1.05          0          0   .94722756 5.537186705
    end
    format %tq date
    label values co co
    label def co 1 "AYALALAND LOG", modify
    label def co 2 "CONCRETE AGGREGATES", modify
    ------------------ copy up to and including the previous line ------------------

    I tried to run xtgcause but got the following result

    . xtgcause roa ltd
    Panel must be strongly balanced and without gaps (no missing values allowed in roa and ltd).
    r(459);


    so i proceed with filling up missing values.
    I know there are two methods of filling up missing values in panel data (imputation, interpolation)
    (If I understand correctly, multiple imputation does not allow dependent variables to have missing values)
    so I tried ipolate command to fill the missing values of one dependent variable and independent variable

    However, when I proceed to the panel granger causality test of the two interpolated variables (newr, newl),, it shows no result and blank result.

    xtgcause newr newl

    Dumitrescu & Hurlin (2012) Granger non-causality test results:
    --------------------------------------------------------------
    Lag order: 1
    W-bar = .
    Z-bar = . (p-value = .)
    Z-bar tilde = . (p-value = .)
    --------------------------------------------------------------
    H0: newl does not Granger-cause newr.
    H1: newl does Granger-cause newr for at least one panelvar (co).

    I have the following question:
    Does Stata recognize that my data is quarterly data?
    How do I make my data strongly balanced?
    What should I do so that there is p-value generated in xtgcause?
    Between mi imputation and ipolate, which one is best to be used in my dataset to fill up the missing values?

    My Stata version is 14.1.

  • #2
    I have the same issue with xtgcause with emply table, please help!

    Comment


    • #3
      Hi Choi,

      The issue is that xtgcause can only be used when the there are no missing values, and that data-set needs to be strongly balanced. You can remove all companies for which the data does not exist for the whole period or you can restrict the sample to less time observation (for which all companies have full data). Or as you point out you could fill up the missing data, but I would warn against this as it could lead to a type I or type II error in your test (an incorrect P value) Please not that at least 8 time observations are required to run the test. Look into the xtset command to see if you have correctly specified your data as quarterly, if not simple google how to do this. xtgranger produces two different p-values and there is little advice avilable for which one to interpret, however EViews only report Z-bar tilde so I would suggest using this P-value. Then it is simply an elementary choice as to the reject or failure to so of the null that is helpful desplayed by the output. Remember that this panel Granger test is actually a non-causality test so rejecting the null means there is evidence of Granger causality in at least one panel (one company in your case) .

      Kind regards,
      Jordan

      Comment


      • #4
        I came across this issue recently and noticed that it seems to occur if a variable you're testing has zero variance over an entire panel grouping. For example, in the data shown in Choi's initial message, "ltd" is zero across the entire panel group "2" --yielding no variance.

        In Choi's case, it is unclear whether the long strings of zeros represent missing data or are meaningful observations. Even in the case that all observations are meaningful, you will likely have to exclude all panel groups with no variation in a tested variable in order for xtgcause to work properly. Fortunately, if the dataset has sufficient panel groups, dropping select groupings should have minimal effect on the outcome of the test.

        Comment

        Working...
        X