Announcement

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

  • Dynamic Panel Model: xtabond2 with Higher-Order Polynomial

    I am trying to estimate poverty trap dynamics in a dynamic panel model using xtabond2 (Stata Version 17.0 on Mac). I have a strongly balanced large N small T data set (1,304 households, 3 time periods), as you can see in the example below. My dependent variable is (log) per capita consumption (lcons), and based on the literature this is estimated as a higher-order polynomial of its first lag, so the general form would be Yit = β1Yi,t−1 + β2(Yi,t−1)2 + β3(Yi,t−1)3 + x′itβ + αi + eit .

    I am having trouble specifying the xtabond2 command. Based on the GMM method of Arellano and Bond (1991), I would difference the equation above to get rid of the fixed effects αi and then use the second lag to instrument the first difference of Yi,t−1. In a previous paper I read that I would need to add Yi,t−2 , (Yi,t−2)2 and (Yi,t−2)3 as instruments for the differenced versions of Yi,t−1 since I have a higher-order polynomial function.

    Could you help me with the specification of the xtabond2 command, especially how to add the squared and cubic independent variables and instruments? Also, is this possible using the ## operator? Most examples I have found so far investigate a relationship between two different variables, so I am not sure how to apply this when my main independent variables are the lags of the regressor (plus control variables). For now I have specified this code:

    Code:
    xtabond2 lcons L.lcons yr2010 yr2012 yr2015 `hhcontrols', gmm(L.lcons) iv(L.lcons) iv(year) robust noleveleq small
    ..., but I am not sure whether this is correct and how to proceed in adding the squared and cubic terms. I would be most appreciative if anyone could help me in getting the correct code for estimating this higher-order model - thank you in advance!

    Code:
    clear
    input double hhid float(year wave lcons)
    10001 2010 1 2.2500415
    10001 2012 2  1.765341
    10001 2015 3 1.6447675
    10002 2010 1 2.3449876
    10002 2012 2 1.3963814
    10002 2015 3 2.1304197
    10003 2010 1 1.7400142
    10003 2012 2  1.296418
    10003 2015 3 1.6074413
    10004 2010 1  1.974242
    10004 2012 2 1.1022048
    10004 2015 3 1.8245966
    10005 2010 1  1.677937
    10005 2012 2 1.7817013
    10005 2015 3  1.764612
    10006 2010 1  1.507018
    10006 2012 2 2.1503625
    10006 2015 3  2.117594
    10008 2010 1   2.13404
    10008 2012 2 1.4497707
    10008 2015 3 1.9650515
    10010 2010 1 2.0031085
    10010 2012 2 1.6417315
    10010 2015 3  1.918212
    end

  • #2
    You could do
    Code:
    xtabond2 lcons L.lcons cL.lcons#cL.lcons cL.lcons#cL.lcons#cL.lcons yr2010 yr2012 yr2015 `hhcontrols', gmm(L.lconsc L.lcons#cL.lcons cL.lcons#cL.lcons#cL.lcons) iv(L.lcons) iv(yr2010 yr2012 yr2015 `hhcontrols') robust noleveleq small
    I have made a few other suggestions on how to modify the command: The year dummies should be instrumented by year dummies, not a time trend. The control variables need to be instrumented as well.

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

    Comment


    • #3
      Thank you very much for your prompt response! I have tried running the code as specified above today, but unfortunately I am still struggling with it. First, when I run it with lcons as you said, I get an error message saying "lcons: factor variables may not contain noninteger values", I assume this is because some of the values are negative (I have around 200 observations with per capita consumption below 1 USD). Then I ran the command using cons (not logged), and the error message disappeared, but I am not sure whether the model runs well. The output I get is as follows:

      Code:
      xtabond2 cons_pc_d_ppp L.cons_pc_d_ppp cL.cons_pc_d_ppp#cL.cons_pc_d_ppp cL.cons_pc_d_ppp#cL.cons_pc_d_ppp#cL.cons_pc_d_ppp yr2010 yr2012 yr2015 `hhcontrols' weight, gmm(L.cons_pc_d_ppp cL.cons_pc_d_ppp#cL.cons_pc_d_ppp cL.cons_pc_d_ppp#cL.cons_pc_d_ppp#cL.cons_pc_d_ppp) iv(L.cons_pc_d_ppp) iv(yr2010 yr2012 yr2015 `hhcontrols') robust noleveleq small
      Favoring space over speed. To switch, type or click on mata: mata set matafavor speed, perm.
      yr2010 dropped due to collinearity
      yr2015 dropped due to collinearity
      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 difference GMM
      ------------------------------------------------------------------------------
      Group variable: hhid                            Number of obs      =      1304
      Time variable : wave                            Number of groups   =      1304
      Number of instruments = 12                      Obs per group: min =         1
      F(0, 1304)    =         .                                      avg =      1.00
      Prob > F      =         .                                      max =         1
      ----------------------------------------------------------------------------------------------------
                                         |               Robust
                           cons_pc_d_ppp | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
      -----------------------------------+----------------------------------------------------------------
                           cons_pc_d_ppp |
                                     L1. |  -5.544253   9.432906    -0.59   0.557    -24.04959    12.96108
                                         |
       cL.cons_pc_d_ppp#cL.cons_pc_d_ppp |   .9158068   1.815598     0.50   0.614    -2.646007     4.47762
                                         |
       cL.cons_pc_d_ppp#cL.cons_pc_d_ppp#|
                        cL.cons_pc_d_ppp |  -.0345547   .0732316    -0.47   0.637    -.1782195      .10911
                                         |
                                  yr2012 |   .4697241   2.047615     0.23   0.819    -3.547256    4.486704
                                  hhsize |  -.5672398   .3825852    -1.48   0.138     -1.31779    .1833101
                               dep_ratio |  -.4161038   .2629834    -1.58   0.114    -.9320207    .0998131
                                age_head |  -.0428281   .0484025    -0.88   0.376    -.1377835    .0521273
                                fem_head |  -.3368613   .7133466    -0.47   0.637    -1.736294    1.062571
                                edu_head |   .0086198   .0491447     0.18   0.861    -.0877915    .1050311
                        age_head_missing |  -2.463069   2.666084    -0.92   0.356    -7.693353    2.767215
                        edu_head_missing |    .139966   .6279588     0.22   0.824    -1.091954    1.371886
                                  weight |  -.1836904   .3795581    -0.48   0.628    -.9283017    .5609208
      ----------------------------------------------------------------------------------------------------
      Instruments for first differences equation
        Standard
          D.(yr2010 yr2012 yr2015 hhsize dep_ratio age_head fem_head edu_head
          age_head_missing edu_head_missing)
          D.L.cons_pc_d_ppp
        GMM-type (missing=0, separate instruments for each period unless collapsed)
          L(1/2).(L.cons_pc_d_ppp cL.cons_pc_d_ppp#cL.cons_pc_d_ppp
          cL.cons_pc_d_ppp#cL.cons_pc_d_ppp#cL.cons_pc_d_ppp)
      ------------------------------------------------------------------------------
      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(0)    =   0.00  Prob > chi2 =      .
        (Not robust, but not weakened by many instruments.)
      Hansen test of overid. restrictions: chi2(0)    =   0.00  Prob > chi2 =      .
        (Robust, but weakened by many instruments.)
      Would you know why the results for the Arellano-Bond test, Sargan and Hansen tests are all missing? Could there be something wrong with my code, or the data? Thanks a lot in advance!

      Comment


      • #4
        The error message "factor variables may not contain noninteger values" should not normally appear when you specify the c. operator everywhere in the interaction terms to indicate that those variables are continuous.

        T=3 is too small for the Arellano-Bond test to be computed. After first differencing and including a lagged dependent variable, there is effectively only 1 time period left. With just 1 time period, you cannot test for serial correlation.

        The Sargan-Hansen tests are not available because the model is just identified. This is again related to T=3 because there are no further lags available which could be used as additional instruments.
        https://www.kripfganz.de/stata/

        Comment


        • #5
          Thank you very much, this makes sense!

          Comment

          Working...
          X