Announcement

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

  • XTABOND2: need help on how to structure the command xtabond2 with System GMM in Panel Data

    Hi everyone,
    I'm using Stata 18 to estimate a Dynamic Panel Data with the System GMM ( two-step).
    I'm analyzing the impact of trade openness on food security across 22 countries over the period 2010-2019.The variables used in the model are:

    - Dependent variable: Food Supply variability as a proxy for food security, which is assumed to be endogenous (lagged dependent variable)
    - Independent variable of interest: Trade (% of GDP) is used as a proxy to measure trade openness, and is assumed to be predetermined
    - Control Variables: GDPconstant, Arableland, Agrprod, Rurpop, Popgr, GDPgr, Empagr, Infr, Exchange_r which are assumed to be exogenous
    - Also year dummies are used as exogenous variables i.Year

    I use system GMM to estimate the following model:
    Code:

    xtabond2 Food_supply L.Food_supply TO lnAgrprod Arableland Empagr lnGDPconstant Popgr Rurpop lnGDPgr Infr lnExchange_r y_2010-y_2019, gmm(L.Food_supply TO, collapse) iv(lnAgrprod Empagr lnGDPconstant Rurpop lnGDPgr Infr lnExchange_r y_2010-y_2019, eq(level)) nodiffsargan twostep robust small orthogonal

    Is the code correct? I've read "How to do xtabond2.." from Roodman but find it hard to implement it. Regarding the instruments iv() I used all my control variables and year dummies which are assumed to be exogenous.
    Can you help me check what's the problem in this code?




  • #2
    Note that all the variables in your iv() option are implicitly assumed to be uncorrelated with the unobserved group-specific effects, akin to a "random-effects" assumption, which is often hard to justify.

    More on GMM estimation of dynamic panel models:
    https://www.kripfganz.de/stata/

    Comment


    • #3
      Thank you very much for the reply.
      I changed dataset, now my N= 51 countries and T=10 (from 2010 until 2019). I also added another independent variable.
      Dependent variable: Food Supply variability as a proxy for food security, which is assumed to be endogenous (lagged dependent variable)
      - Independent variable of interest: Trade (% of GDP) is used as a proxy to measure trade openness, and is assumed to be predetermined
      - Control Variables: GDPconstant, Arableland, Agrprod, Rurpop, Popgr, GDPgr, Empagr, Infr, Exchange_r and Politicalstability.
      - Also year dummies are used as exogenous variables i.Year

      the code I used is:

      Code:
      xtabond2 lnFood_supply L.lnFood_supply lnTO_  lnGDPcons lnArablel lnAgriprod lnRurpop lnPopgr lnGDPgrowth lnEmplagri lnInflrate lnExcrate lnPolit_st y_2010-y_2019 ///
      gmm(lnFood_supply, lag(2 4) equation (diff) collapse) gmm(lnTO_ lnGDPcons lnArablel lnAgriprod lnRurpop lnPopgr lnGDPgrowth lnEmplagri lnInflrate lnExcrate lnPolit_st, lag (1 2) equation(level) collapse) ///
      iv(i.Year) orthogonal small twostep robust
      - Can you please help me in defining this command? Is it correct? Even though I try multiple ways I'm unsure if it's the appropriate way.
      - Is the year dummy written in the correct way or should I use y_2010-y_2019 instead of i.Year?

      Comment


      • #4
        This is the results I get, which are not promising, something must be wrong in the code. Please help me find what is wrong.

        Code:
        xtabond2 lnFood_supply L.lnFood_supply lnTO_ lnGDPcons lnArablel lnAgriprod lnRurpop lnPopgr lnGDPgrowth lnEmpla
        > gri lnInflrate lnExcrate lnPolit_st y_2010-y_2019, gmm(lnFood_supply, lag(2 4) equation (diff) collapse) gmm(lnT
        > O_ lnGDPcons lnArablel lnAgriprod lnRurpop lnPopgr lnGDPgrowth lnEmplagri lnInflrate lnExcrate lnPolit_st, lag (
        > 1 3) equation(level) collapse) iv(i.Year) orthogonal small twostep robust
        Favoring speed over space. To switch, type or click on mata: mata set matafavor space, perm.
        y_2010 dropped due to collinearity
        y_2019 dropped due to collinearity
        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 optimal weighting matrix for two-step estimation.
          Difference-in-Sargan/Hansen statistics may be negative.
        
        Dynamic panel-data estimation, two-step system GMM
        ------------------------------------------------------------------------------
        Group variable: Country                         Number of obs      =        56
        Time variable : Year                            Number of groups   =        14
        Number of instruments = 45                      Obs per group: min =         1
        F(20, 13)     =   2002.00                                      avg =      4.00
        Prob > F      =     0.000                                      max =         8
        -------------------------------------------------------------------------------
                      |              Corrected
        lnFood_supply | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
        --------------+----------------------------------------------------------------
        lnFood_supply |
                  L1. |   .2969922   2.161139     0.14   0.893    -4.371864    4.965849
                      |
                lnTO_ |          0  (omitted)
            lnGDPcons |   -.504847   1.339901    -0.38   0.712    -3.399528    2.389834
            lnArablel |          0  (omitted)
           lnAgriprod |   .2227424   .3157529     0.71   0.493    -.4594004    .9048851
             lnRurpop |          0  (omitted)
              lnPopgr |          0  (omitted)
          lnGDPgrowth |   3.285379   4.775184     0.69   0.504    -7.030779    13.60154
           lnEmplagri |          0  (omitted)
           lnInflrate |   .0615131   1.628267     0.04   0.970    -3.456143    3.579169
            lnExcrate |  -.3005696   .2832862    -1.06   0.308    -.9125722    .3114331
           lnPolit_st |  -1.916431   2.346799    -0.82   0.429    -6.986381     3.15352
               y_2011 |  -.4783484   1.534662    -0.31   0.760    -3.793784    2.837087
               y_2012 |   .0955533   .8929269     0.11   0.916    -1.833498    2.024605
               y_2013 |          0  (omitted)
               y_2014 |   .2391051   2.468627     0.10   0.924     -5.09404     5.57225
               y_2015 |  -.9852677   1.842624    -0.53   0.602    -4.966015     2.99548
               y_2016 |  -1.418538   1.815566    -0.78   0.449     -5.34083    2.503754
               y_2017 |  -1.163838   .9947491    -1.17   0.263    -3.312863    .9851866
               y_2018 |   .6801099   1.521459     0.45   0.662    -2.606802    3.967022
                _cons |          0  (omitted)
        -------------------------------------------------------------------------------
        Instruments for orthogonal deviations equation
          Standard
            FOD.(2010b.Year 2011.Year 2012.Year 2013.Year 2014.Year 2015.Year
            2016.Year 2017.Year 2018.Year 2019.Year)
          GMM-type (missing=0, separate instruments for each period unless collapsed)
            L(2/4).lnFood_supply collapsed
        Instruments for levels equation
          Standard
            2010b.Year 2011.Year 2012.Year 2013.Year 2014.Year 2015.Year 2016.Year
            2017.Year 2018.Year 2019.Year
            _cons
          GMM-type (missing=0, separate instruments for each period unless collapsed)
            DL(1/3).(lnTO_ lnGDPcons lnArablel lnAgriprod lnRurpop lnPopgr lnGDPgrowth
            lnEmplagri lnInflrate lnExcrate lnPolit_st) collapsed
        ------------------------------------------------------------------------------
        Arellano-Bond test for AR(1) in first differences: z =   0.32  Pr > z =  0.749
        Arellano-Bond test for AR(2) in first differences: z =  -0.79  Pr > z =  0.431
        ------------------------------------------------------------------------------
        Sargan test of overid. restrictions: chi2(24)   =  32.49  Prob > chi2 =  0.115
          (Not robust, but not weakened by many instruments.)
        Hansen test of overid. restrictions: chi2(24)   =   0.00  Prob > chi2 =  1.000
          (Robust, but weakened by many instruments.)
        
        Difference-in-Hansen tests of exogeneity of instrument subsets:
          iv(2010b.Year 2011.Year 2012.Year 2013.Year 2014.Year 2015.Year 2016.Year 2017.Year 2018.Year 2019.Year)
            Hansen test excluding group:     chi2(23)   =   0.00  Prob > chi2 =  1.000
            Difference (null H = exogenous): chi2(1)    =  -0.00  Prob > chi2 =  1.000

        Comment

        Working...
        X