Announcement

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

  • system GMM and xtabond2

    Hi,

    I am trying to run the following Stata code:

    xtabond2 ggdpwok lnN lnLDTF rd_abs_cap lnSch hc_abs_cap gto gfdi gfd ginf Equator _IYear_1980-_IYear_2004 _Icode_2-_Icode_76, gmm(lnN lnLDTF rd_abs_cap lnSch hc_abs_cap gto gfdi gfd ginf Equator , lag(2 3) collapse) iv( Equator _IYear_1980-_IYear_2004 _Icode_2-_Icode_76 lnGp lnLaw lnciv_lib civ_lib_instru Gp_instr Law_instr, equation(level) mz) iv(lnGp lnLaw lnciv_lib civ_lib_instru Gp_instr Law_instr, equation(diff) mz) h(2) small robust orthogonal

    where ggdpwok63 = growth in GDP per worker, lnN = number of scientists/labor force, lnLDTF = lag of distance to frontier, rd_abs_cap = N*lnLDTF, lnSch = number of Schooling years, hc_abs_cap = Sch*lnLDTF, gto = growth in Trade Openness, gfdi = growth in Foreign Direct Investment, gfd = growth in Financial Development, ginf = growth in Inflation, Equator = distance from the Equator, _Icode_* = country dummies.
    I have also used three external instruments for lnN and rd_abs_cap variables - lnGp lnLaw lnciv_lib civ_lib_instru Gp_instr Law_instr.

    When I run this code I get the following output:

    Favoring speed over space. To switch, type or click on mata: mata set matafavor space, perm.
    Warning: Number of instruments may be large relative to number of observations.
    Warning: Two-step estimated covariance matrix of moments is singular.
    Using a generalized inverse to calculate robust weighting matrix for Hansen test.
    Difference-in-Sargan/Hansen statistics may be negative.

    Dynamic panel-data estimation, one-step system GMM
    ------------------------------------------------------------------------------
    Group variable: code Number of obs = 267
    Time variable : Year Number of groups = 51
    Number of instruments = 68 Obs per group: min = 2
    F(70, 50) = 0.02 avg = 5.24
    Prob > F = 1.000 max = 6
    ------------------------------------------------------------------------------
    | Robust
    ggdpwok63 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    lnN_63 | .1327033 .5287111 0.25 0.803 -.9292441 1.194651
    lnLDTF_63 | .0896352 .304926 0.29 0.770 -.5228266 .702097
    rd_abs_cap63 | -71.38988 353.0837 -0.20 0.841 -780.5794 637.7997
    lnSch | -.0898262 1.114015 -0.08 0.936 -2.327392 2.14774
    hc_abs_cap63 | .0315583 .1803599 0.17 0.862 -.3307051 .3938217
    gto | -.1503666 3.035454 -0.05 0.961 -6.247256 5.946523
    gfdi | .2948146 1.758478 0.17 0.868 -3.237192 3.826821
    gfd | -.5871786 4.198735 -0.14 0.889 -9.020585 7.846228
    ginf | .1318845 .992694 0.13 0.895 -1.862 2.125769
    Equator | 0 (omitted)
    _IYear_1980 | .0196844 .2283681 0.09 0.932 -.4390064 .4783751
    _IYear_1985 | .0097323 .3235021 0.03 0.976 -.6400407 .6595054
    _IYear_1990 | -.0833573 .2636217 -0.32 0.753 -.612857 .4461424
    _IYear_1995 | -.0089182 .347079 -0.03 0.980 -.7060468 .6882104
    _IYear_2000 | -.1026526 .2800109 -0.37 0.715 -.665071 .4597659
    _IYear_2004 | 0 (omitted)
    _Icode_2 | -.0021944 .4459723 -0.00 0.996 -.897956 .8935673
    _Icode_3 | .0424367 .4418103 0.10 0.924 -.8449653 .9298388
    _Icode_4 | 0 (omitted)
    _Icode_6 | -.3307094 1.986137 -0.17 0.868 -4.319983 3.658565
    _Icode_7 | -.1147691 1.143146 -0.10 0.920 -2.410846 2.181308
    _Icode_8 | .0083396 .4198757 0.02 0.984 -.8350055 .8516847
    _Icode_9 | -.0483935 .3203886 -0.15 0.881 -.6919129 .5951259
    _Icode_10 | -.0190113 .3965933 -0.05 0.962 -.8155923 .7775698
    _Icode_12 | .0091542 .6564318 0.01 0.989 -1.309328 1.327636
    _Icode_13 | .0297619 .3535788 0.08 0.933 -.6804221 .7399458
    _Icode_16 | 0 (omitted)
    _Icode_17 | -.0319111 .1688915 -0.19 0.851 -.3711397 .3073176
    _Icode_18 | -.0995618 .8297623 -0.12 0.905 -1.766189 1.567065
    _Icode_19 | -.0635913 1.11975 -0.06 0.955 -2.312675 2.185493
    _Icode_20 | .0457435 .1735193 0.26 0.793 -.3027802 .3942672
    _Icode_22 | -.0637497 .4813999 -0.13 0.895 -1.03067 .9031704
    _Icode_23 | -.0238168 .3222235 -0.07 0.941 -.6710218 .6233881
    _Icode_24 | .0098986 .2143668 0.05 0.963 -.4206698 .4404669
    _Icode_25 | .0999317 .463785 0.22 0.830 -.8316079 1.031471
    _Icode_26 | .0749898 .6040769 0.12 0.902 -1.138334 1.288314
    _Icode_30 | -.1419504 1.320223 -0.11 0.915 -2.793697 2.509796
    _Icode_31 | -.2078377 1.776777 -0.12 0.907 -3.7766 3.360925
    _Icode_32 | -.0677328 .3346197 -0.20 0.840 -.7398362 .6043706
    _Icode_33 | .1223687 .3588874 0.34 0.735 -.5984778 .8432152
    _Icode_34 | 0 (omitted)
    _Icode_36 | .0245295 .3262866 0.08 0.940 -.6308364 .6798953
    _Icode_37 | -.0882795 .5067618 -0.17 0.862 -1.10614 .9295815
    _Icode_38 | -.0558884 .761249 -0.07 0.942 -1.584902 1.473125
    _Icode_39 | -.2550232 1.571 -0.16 0.872 -3.410469 2.900422
    _Icode_43 | .0010093 .4051471 0.00 0.998 -.8127526 .8147712
    _Icode_45 | .0150852 .4451187 0.03 0.973 -.878962 .9091323
    _Icode_46 | .1127042 .2495154 0.45 0.653 -.3884621 .6138705
    _Icode_47 | -.0407305 2.178711 -0.02 0.985 -4.416801 4.33534
    _Icode_48 | -.0188414 .5459609 -0.03 0.973 -1.115436 1.077753
    _Icode_49 | -.0357262 .4782968 -0.07 0.941 -.9964137 .9249613
    _Icode_50 | .0047142 .5155523 0.01 0.993 -1.030803 1.040231
    _Icode_51 | -.0749326 1.400614 -0.05 0.958 -2.888148 2.738283
    _Icode_52 | -.1187904 1.027655 -0.12 0.908 -2.182896 1.945315
    _Icode_53 | -.1941037 1.141409 -0.17 0.866 -2.486692 2.098484
    _Icode_54 | -.1299804 .9662215 -0.13 0.894 -2.070693 1.810733
    _Icode_56 | .000116 .4587344 0.00 1.000 -.9212791 .9215112
    _Icode_57 | 0 (omitted)
    _Icode_60 | .0153699 1.34487 0.01 0.991 -2.685882 2.716621
    _Icode_62 | -.084485 1.560268 -0.05 0.957 -3.218376 3.049406
    _Icode_63 | -.1540166 1.494619 -0.10 0.918 -3.156047 2.848014
    _Icode_67 | -.0662114 .2763134 -0.24 0.812 -.6212031 .4887803
    _Icode_68 | -.0181051 .8098449 -0.02 0.982 -1.644727 1.608516
    _Icode_69 | .0277414 .6441215 0.04 0.966 -1.266015 1.321497
    _Icode_70 | -.0997056 1.053593 -0.09 0.925 -2.21591 2.016499
    _Icode_72 | -.0308534 .3494538 -0.09 0.930 -.732752 .6710453
    _Icode_73 | -.056583 .6259202 -0.09 0.928 -1.313781 1.200615
    _Icode_74 | -.0203936 .5400383 -0.04 0.970 -1.105092 1.064305
    _Icode_75 | -.1441631 1.022607 -0.14 0.888 -2.19813 1.909804
    _Icode_76 | -.3709036 2.108591 -0.18 0.861 -4.606133 3.864326
    _cons | .976186 5.090067 0.19 0.849 -9.247515 11.19989
    ------------------------------------------------------------------------------
    Instruments for orthogonal deviations equation
    Standard
    FOD.(lnGp lnLaw lnciv_lib civ_lib_instru Gp_instr63 Law_instr63), missing
    recoded as zero
    GMM-type (missing=0, separate instruments for each period unless collapsed)
    L(2/3).(lnN_63 lnLDTF_63 rd_abs_cap63 lnSch hc_abs_cap63 gto gfdi gfd ginf
    Equator) collapsed
    Instruments for levels equation
    Standard
    Equator _IYear_1980 _IYear_1985 _IYear_1990 _IYear_1995 _IYear_2000
    _IYear_2004 _Icode_2 _Icode_3 _Icode_4 _Icode_6 _Icode_7 _Icode_8 _Icode_9
    _Icode_10 _Icode_12 _Icode_13 _Icode_16 _Icode_17 _Icode_18 _Icode_19
    _Icode_20 _Icode_22 _Icode_23 _Icode_24 _Icode_25 _Icode_26 _Icode_30
    _Icode_31 _Icode_32 _Icode_33 _Icode_34 _Icode_36 _Icode_37 _Icode_38
    _Icode_39 _Icode_43 _Icode_45 _Icode_46 _Icode_47 _Icode_48 _Icode_49
    _Icode_50 _Icode_51 _Icode_52 _Icode_53 _Icode_54 _Icode_56 _Icode_57
    _Icode_60 _Icode_62 _Icode_63 _Icode_67 _Icode_68 _Icode_69 _Icode_70
    _Icode_72 _Icode_73 _Icode_74 _Icode_75 _Icode_76 lnGp lnLaw lnciv_lib
    civ_lib_instru Gp_instr63 Law_instr63, missing recoded as zero
    _cons
    GMM-type (missing=0, separate instruments for each period unless collapsed)
    DL.(lnN_63 lnLDTF_63 rd_abs_cap63 lnSch hc_abs_cap63 gto gfdi gfd ginf
    Equator) collapsed
    ------------------------------------------------------------------------------
    Arellano-Bond test for AR(1) in first differences: z = . Pr > z = .
    Arellano-Bond test for AR(2) in first differences: z = . Pr > z = .
    ------------------------------------------------------------------------------
    Sargan test of overid. restrictions: chi2(-3) = 0.01 Prob > chi2 = .
    (Not robust, but not weakened by many instruments.)
    Hansen test ofoverid. restrictions: chi2(-3) = 0.00 Prob > chi2 = .
    (Robust, but weakened by many instruments.)



    I have the following questions:
    1. I don't know why the Equator (time-invariant) variable is being omitted? I have checked the discussions on time-invariant variable in this forum. Am I still missing something?
    2. I have a 5-year average data from 1975 to 2004. Only a few countries have a couple of years of missing data. But still, AR(1) and AR(2) are missing. I don't know why.
    3. There are also four country codes which are omitted. I checked with my data and I found that these countries have missing data for two or three years. I am also not able to understand this.

    Please help me.

    Thanks,
    Bharat

  • #2
    You should not include country dummies at all. The whole idea of the system-GMM approach is that these country fixed effects are part of the error term and you are using instruments that are uncorrelated with them.
    https://www.kripfganz.de/stata/

    Comment


    • #3
      Dear Dr. Kripfganz,

      Thank you for the reply. I removed the country dummies and now the Equator variable is not omitted. I still have a couple of questions:
      1. When I use twostep instead of onestep I find that the year2004 dummy and the constant both are omitted. Can you please explain this.
      2. Also, I have not used the nodiffsargan option. But still, the difference-in-Hansen test is not reported. Can you please explain this also.

      Sincerely,
      Bharat

      Comment


      • #4
        1. You have a maximum of 6 time periods. That allows you to identify the coefficients of 5 time dummies plus the constant, if there is no additional multicolinearity with other variables. I do not have an answer to the question, why the two-step estimator also drops the constant in your case.
        2. My guess is that the model is no longer identified (not enough instruments) if either the gmm() or the iv() option is dropped. In that case, xtabond2 cannot compute difference-in-Sargan test statistics. You might want to split the instruments into multiple gmm() and iv() options.
        Last edited by Sebastian Kripfganz; 12 Jul 2017, 07:32.
        https://www.kripfganz.de/stata/

        Comment


        • #5
          Dr. Kripfganz,

          Thank you for your quick reply. I followed your suggestion and split the instruments into multiple gmm () and iv () options. The following is the code:

          xtabond2 ggdpwok63 lnN_63 lnLDTF_63 rd_abs_cap63 lnSch hc_abs_cap63 gto gfdi gfd ginf Equator _IYear_1975-_IYear_2004,
          gmm(lnN_63 lnLDTF_63 rd_abs_cap63 lnSch hc_abs_cap63 gto gfdi gfd ginf , lag(2 3) collapse equation(diff))
          gmm(lnN_63 lnLDTF_63 rd_abs_cap63 lnSch hc_abs_cap63 gto gfdi gfd ginf , lag(2 3) collapse equation(level))
          iv(Equator _IYear_1975-_IYear_2004 lnGp lnLaw lnciv_lib civ_lib_instru Gp_instr63 Law_instr63, equation(level) mz)
          iv(Equator _IYear_1975-_IYear_2004 lnGp lnLaw lnciv_lib civ_lib_instru Gp_instr63 Law_instr63, equation(diff) mz) h(2) small robust orthogonal

          This is the output I get:

          Dynamic panel-data estimation, one-step system GMM
          ------------------------------------------------------------------------------
          Group variable: code Number of obs = 267
          Time variable : Year Number of groups = 51
          Number of instruments = 24 Obs per group: min = 2
          F(17, 50) = 3.74 avg = 5.24
          Prob > F = 0.000 max = 6
          ------------------------------------------------------------------------------
          | Robust
          ggdpwok63 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
          -------------+----------------------------------------------------------------
          lnN_63 | .0073567 .0280439 0.26 0.794 -.048971 .0636845
          lnLDTF_63 | -.0150475 .0299465 -0.50 0.618 -.0751968 .0451017
          rd_abs_cap63 | 8.193131 14.71953 0.56 0.580 -21.37191 37.75818
          lnSch | -.0139618 .0615065 -0.23 0.821 -.1375014 .1095777
          hc_abs_cap63 | .0053502 .0077214 0.69 0.492 -.0101586 .020859
          gto | .0913699 .1629516 0.56 0.577 -.235928 .4186678
          gfdi | .0007277 .0239749 0.03 0.976 -.0474273 .0488827
          gfd | .1182394 .1272439 0.93 0.357 -.1373374 .3738162
          ginf | -.000312 .0207259 -0.02 0.988 -.0419413 .0413173
          Equator | .0030675 .0573669 0.05 0.958 -.1121573 .1182922
          _IYear_1975 | 0 (omitted)
          _IYear_1980 | -.0025462 .0063992 -0.40 0.692 -.0153994 .010307
          _IYear_1985 | -.0168683 .0101839 -1.66 0.104 -.0373233 .0035868
          _IYear_1990 | -.0087622 .0106027 -0.83 0.412 -.0300584 .012534
          _IYear_1995 | -.0158891 .0127007 -1.25 0.217 -.0413991 .009621
          _IYear_2000 | -.0204989 .0129523 -1.58 0.120 -.0465144 .0055166
          _IYear_2004 | 0 (omitted)
          _cons | .0784087 .3090976 0.25 0.801 -.542432 .6992494
          ------------------------------------------------------------------------------
          Instruments for orthogonal deviations equation
          Standard
          FOD.(Equator _IYear_1975 _IYear_1980 _IYear_1985 _IYear_1990 _IYear_1995
          _IYear_2000 _IYear_2004 lnGp lnLaw lnciv_lib civ_lib_instru Gp_instr63
          Law_instr63), missing recoded as zero
          GMM-type (missing=0, separate instruments for each period unless collapsed)
          L(2/3).(lnN_63 lnLDTF_63 rd_abs_cap63 lnSch hc_abs_cap63 gto gfdi gfd
          ginf) collapsed
          Instruments for levels equation
          Standard
          Equator _IYear_1975 _IYear_1980 _IYear_1985 _IYear_1990 _IYear_1995
          _IYear_2000 _IYear_2004 lnGp lnLaw lnciv_lib civ_lib_instru Gp_instr63
          Law_instr63, missing recoded as zero
          _cons
          GMM-type (missing=0, separate instruments for each period unless collapsed)
          DL(2/3).(lnN_63 lnLDTF_63 rd_abs_cap63 lnSch hc_abs_cap63 gto gfdi gfd
          ginf) collapsed
          ------------------------------------------------------------------------------
          Arellano-Bond test for AR(1) in first differences: z = . Pr > z = .
          Arellano-Bond test for AR(2) in first differences: z = . Pr > z = .
          ------------------------------------------------------------------------------
          Sargan test of overid. restrictions: chi2(6) = 3.78 Prob > chi2 = 0.707
          (Not robust, but not weakened by many instruments.)
          Hansen test of
          overid. restrictions: chi2(6) = 4.39 Prob > chi2 = 0.624
          (Robust, but weakened by many instruments.)



          Difference-in-Sargan test statistics is still not reported. If I use lags 2 and above, instead of lags 2 and 3, then Difference-in-Sargan test statistics is reported.

          I have also noticed that the t-statistics for the coefficients are not significant. Yet, the overall F is significant. I guess this is an indicator that there is multicollinearity. I also checked the correlation matrix of the variables which are pasted below:


          | lnN_63 lnLDT~63 rd_ab~63 lnSch hc_ab~63 gtogfdigfdginf
          -------------+---------------------------------------------------------------------------------
          lnN_63 | 1.0000
          lnLDTF_63 | -0.7898 1.0000
          rd_abs_cap63 | 0.4431 0.0067 1.0000
          lnSch | 0.7206 -0.7548 0.1229 1.0000
          hc_abs_cap63 | -0.4624 0.5886 0.1184 -0.0146 1.0000
          gto | -0.0176 -0.0059 -0.0566 0.0375 0.0273 1.0000
          gfdi | 0.0631 -0.0467 0.0584 0.0858 -0.0210 0.1476 1.0000
          gfd | 0.0459 -0.0487 -0.0127 0.1018 0.0350 0.0356 0.2021 1.0000
          ginf | -0.0339 -0.0857 -0.0930 -0.0666 -0.1352 0.1022 0.0038 -0.0395 1.0000
          Equator | 0.7961 -0.6919 0.2703 0.4944 -0.5555 0.0204 0.0746 0.0589 0.0021



          I didn't find a very high correlation between the regressors.

          Please let me know what can I do to solve the problem.

          Thank you,
          Bharat

          Comment

          Working...
          X