My data is structured as follows

Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input int(id year) float y byte x1 float(x2 x3 x4)
4 2002     . 0         .    .         .
4 2003     . 0         .    .         .
4 2004  77.5 0 1.1184173    .  2.397895
4 2005 69.23 0 1.2320774  .03  2.484907
4 2006 69.64 0  1.198828  .09  2.397895
4 2007 69.05 0  1.168271  .03  2.484907
4 2008 71.25 0  .9770876  .01  2.397895
4 2009 68.75 0  .9854457  .01  2.397895
4 2010 69.05 1  .8685386  .01  2.484907
4 2011 71.43 1     .9251  .01  2.564949
4 2012 65.85 1  .8766528  .01  2.564949
4 2013  68.6 1  .9305043 -.12  2.564949
4 2014 70.93 1  .9707114  .01 2.6390574
4 2015 74.47 1 1.0396616  .01  2.397895
4 2016 68.75 1  .9870396  .02  2.397895
4 2017 76.92 1  .9896186  .02  2.397895
4 2018 75.68 1  1.042021  .02  2.397895
4 2019 73.38 1 1.0807108  .02  2.397895
4 2020 72.29 1  1.139076  .02  2.397895
4 2021  48.8 1 1.1821591  .02  2.397895
4 2022     . 1         .    .         .
end


When I type this code
Code:
xtabond2 y l.y l2.y  i.x1 x2 x3 x4 year*, gmm(y, laglimits(6 9) collapse) gmm(x4, laglimits(0 0) eq(level) collapse) gmm( x1, laglimits (1 6)) iv(x2) iv(x3) iv( year*, eq(level)) twostep rob
I get the following results [Table I]:
Code:
Dynamic panel-data estimation, two-step system GMM
------------------------------------------------------------------------------
Group variable: id                              Number of obs      =     56230
Time variable : year                            Number of groups   =      8009
Number of instruments = 76                      Obs per group: min =         1
Wald chi2(7)  = 305279.82                                      avg =      7.02
Prob > chi2   =     0.000                                      max =        18
------------------------------------------------------------------------------
             |              Corrected
           y |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
           y |
         L1. |   .6579452   .1257772     5.23   0.000     .4114264     .904464
         L2. |    .203073   .1159586     1.75   0.080    -.0242018    .4303477
             |
        1.x1 |   1.731265   .6617663     2.62   0.009     .4342269    3.028303
          x2 |   -.181484    .059002    -3.08   0.002    -.2971259   -.0658422
          x3 |   6.685274   .6702776     9.97   0.000     5.371554    7.998994
          x4 |   2.542435   .9939581     2.56   0.011     .5943129    4.490557
        year |   .1915175   .0268854     7.12   0.000      .138823     .244212
       _cons |  -382.9742     55.254    -6.93   0.000    -491.2701   -274.6784
------------------------------------------------------------------------------
Instruments for first differences equation
  Standard
    D.x3
    D.x2
  GMM-type (missing=0, separate instruments for each period unless collapsed)
    L(1/6).x1
    L(6/9).y collapsed
Instruments for levels equation
  Standard
    year
    x3
    x2
    _cons
  GMM-type (missing=0, separate instruments for each period unless collapsed)
    D.x1
    D.x4 collapsed
    DL5.y collapsed
------------------------------------------------------------------------------
Arellano-Bond test for AR(1) in first differences: z =  -3.06  Pr > z =  0.002
Arellano-Bond test for AR(2) in first differences: z =  -0.44  Pr > z =  0.661
------------------------------------------------------------------------------
Sargan test of overid. restrictions: chi2(68)   =  74.56  Prob > chi2 =  0.274
  (Not robust, but not weakened by many instruments.)
Hansen test of overid. restrictions: chi2(68)   =  74.73  Prob > chi2 =  0.269
  (Robust, but weakened by many instruments.)

Difference-in-Hansen tests of exogeneity of instrument subsets:
  GMM instruments for levels
    Hansen test excluding group:     chi2(55)   =  54.86  Prob > chi2 =  0.480
    Difference (null H = exogenous): chi2(13)   =  19.87  Prob > chi2 =  0.098
  gmm(y, collapse lag(6 9))
    Hansen test excluding group:     chi2(63)   =  62.68  Prob > chi2 =  0.488
    Difference (null H = exogenous): chi2(5)    =  12.06  Prob > chi2 =  0.034
  gmm(x4, collapse eq(level) lag(0 0))
    Hansen test excluding group:     chi2(67)   =  74.71  Prob > chi2 =  0.242
    Difference (null H = exogenous): chi2(1)    =   0.02  Prob > chi2 =  0.877
  gmm(x1, lag(1 6))
    Hansen test excluding group:     chi2(2)    =   1.84  Prob > chi2 =  0.399
    Difference (null H = exogenous): chi2(66)   =  72.89  Prob > chi2 =  0.262
  iv(x2)
    Hansen test excluding group:     chi2(67)   =  74.64  Prob > chi2 =  0.244
    Difference (null H = exogenous): chi2(1)    =   0.10  Prob > chi2 =  0.756
  iv(x3)
    Hansen test excluding group:     chi2(67)   =  74.72  Prob > chi2 =  0.242
    Difference (null H = exogenous): chi2(1)    =   0.02  Prob > chi2 =  0.899
  iv(year, eq(level))
    Hansen test excluding group:     chi2(67)   =  72.87  Prob > chi2 =  0.291
    Difference (null H = exogenous): chi2(1)    =   1.86  Prob > chi2 =  0.173
And when I add another lagged dependent variable by typing the following code:
Code:
xtabond2 y l.y l2.y l3.y i.x1 x2 x3 x4 year*, gmm(y, laglimits(6 9) collapse) gmm(x4, laglimits(0 0) eq(level) collapse) gmm( x1, laglimits (1 6)) iv(x2) iv(x3) iv( year*, eq(level)) twostep rob
I get the follwing results [Table II]:

Code:
Dynamic panel-data estimation, two-step system GMM
------------------------------------------------------------------------------
Group variable: id                              Number of obs      =     48584
Time variable : year                            Number of groups   =      6865
Number of instruments = 75                      Obs per group: min =         1
Wald chi2(8)  = 290706.28                                      avg =      7.08
Prob > chi2   =     0.000                                      max =        17
------------------------------------------------------------------------------
             |              Corrected
           y |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
           y |
         L1. |   .6406586   .1225116     5.23   0.000     .4005402    .8807771
         L2. |   .1945418   .1598152     1.22   0.223    -.1186903    .5077739
         L3. |   .0162681   .1021677     0.16   0.873     -.183977    .2165131
             |
        1.x1 |   1.616271   .6009242     2.69   0.007     .4384809     2.79406
          x2 |  -.1789571   .0708278    -2.53   0.012     -.317777   -.0401372
          x3 |   6.718723    .800452     8.39   0.000     5.149866     8.28758
          x4 |   3.199218   1.119148     2.86   0.004     1.005728    5.392707
        year |   .2022503   .0304903     6.63   0.000     .1424904    .2620103
       _cons |  -405.5231   62.75726    -6.46   0.000    -528.5251   -282.5211
------------------------------------------------------------------------------
Instruments for first differences equation
  Standard
    D.x3
    D.x2
  GMM-type (missing=0, separate instruments for each period unless collapsed)
    L(1/6).x1
    L(6/9).y collapsed
Instruments for levels equation
  Standard
    year
    x3
    x2
    _cons
  GMM-type (missing=0, separate instruments for each period unless collapsed)
    D.x1
    D.x4 collapsed
    DL5.y collapsed
------------------------------------------------------------------------------
Arellano-Bond test for AR(1) in first differences: z =  -2.88  Pr > z =  0.004
Arellano-Bond test for AR(2) in first differences: z =  -0.22  Pr > z =  0.829
------------------------------------------------------------------------------
Sargan test of overid. restrictions: chi2(66)   =  74.83  Prob > chi2 =  0.214
  (Not robust, but not weakened by many instruments.)
Hansen test of overid. restrictions: chi2(66)   =  76.21  Prob > chi2 =  0.183
  (Robust, but weakened by many instruments.)

Difference-in-Hansen tests of exogeneity of instrument subsets:
  GMM instruments for levels
    Hansen test excluding group:     chi2(53)   =  59.37  Prob > chi2 =  0.255
    Difference (null H = exogenous): chi2(13)   =  16.84  Prob > chi2 =  0.207
  gmm(y, collapse lag(6 9))
    Hansen test excluding group:     chi2(61)   =  68.55  Prob > chi2 =  0.237
    Difference (null H = exogenous): chi2(5)    =   7.66  Prob > chi2 =  0.176
  gmm(x4, collapse eq(level) lag(0 0))
    Hansen test excluding group:     chi2(65)   =  76.07  Prob > chi2 =  0.164
    Difference (null H = exogenous): chi2(1)    =   0.15  Prob > chi2 =  0.703
  gmm(x1, lag(1 6))
    Hansen test excluding group:     chi2(1)    =   1.69  Prob > chi2 =  0.193
    Difference (null H = exogenous): chi2(65)   =  74.52  Prob > chi2 =  0.196
  iv(x2)
    Hansen test excluding group:     chi2(65)   =  76.20  Prob > chi2 =  0.161
    Difference (null H = exogenous): chi2(1)    =   0.01  Prob > chi2 =  0.926
  iv(x3)
    Hansen test excluding group:     chi2(65)   =  76.08  Prob > chi2 =  0.164
    Difference (null H = exogenous): chi2(1)    =   0.13  Prob > chi2 =  0.714
  iv(year, eq(level))
    Hansen test excluding group:     chi2(65)   =  75.80  Prob > chi2 =  0.169
    Difference (null H = exogenous): chi2(1)    =   0.41  Prob > chi2 =  0.522
My questions:

1- To my understanding, the coefficients on the yit-1 and yit-2 should be significant to justify including them in the model. However, as can be seen, including the yit-2 improves the various specification tests but causes yit-1 coefficent to become insignificant. Can you advise me on which estimation procedure is more valid?

2- The past values of some predetermined variables (i.e., x2) are endogenous to the current period, which causes the various specification tests to faill. For instance, when I type:

Code:
xtabond2 y l.y l2.y i.x1 x2 x3 x4 year*, gmm(y, laglimits(6 9) collapse) gmm(x4, laglimits(0 0) eq(level) collapse) gmm( x1, laglimits (1 6)) gmm(x2, eq(level) collapse) iv(x3) iv( year*, eq(level)) twostep rob
I get [Table III]:
Code:
------------------------------------------------------------------------------
Arellano-Bond test for AR(1) in first differences: z =  -4.79  Pr > z =  0.000
Arellano-Bond test for AR(2) in first differences: z =   1.78  Pr > z =  0.076
------------------------------------------------------------------------------
Sargan test of overid. restrictions: chi2(85)   = 102.61  Prob > chi2 =  0.094
  (Not robust, but not weakened by many instruments.)
Hansen test of overid. restrictions: chi2(85)   = 120.07  Prob > chi2 =  0.007
  (Robust, but weakened by many instruments.)

Difference-in-Hansen tests of exogeneity of instrument subsets:
  GMM instruments for levels
    Hansen test excluding group:     chi2(54)   =  54.31  Prob > chi2 =  0.462
    Difference (null H = exogenous): chi2(31)   =  65.76  Prob > chi2 =  0.000
  gmm(y, collapse lag(6 9))
    Hansen test excluding group:     chi2(80)   =  99.36  Prob > chi2 =  0.070
    Difference (null H = exogenous): chi2(5)    =  20.70  Prob > chi2 =  0.001
  gmm(x4, collapse eq(level) lag(0 0))
    Hansen test excluding group:     chi2(84)   = 119.19  Prob > chi2 =  0.007
    Difference (null H = exogenous): chi2(1)    =   0.88  Prob > chi2 =  0.348
  gmm(x1, lag(1 6))
    Hansen test excluding group:     chi2(19)   =  40.52  Prob > chi2 =  0.003
    Difference (null H = exogenous): chi2(66)   =  79.54  Prob > chi2 =  0.122
  gmm(x2, collapse eq(level) lag(1 .))
    Hansen test excluding group:     chi2(67)   =  76.26  Prob > chi2 =  0.205
    Difference (null H = exogenous): chi2(18)   =  43.81  Prob > chi2 =  0.001
  iv(x3)
    Hansen test excluding group:     chi2(84)   = 119.95  Prob > chi2 =  0.006
    Difference (null H = exogenous): chi2(1)    =   0.11  Prob > chi2 =  0.735
  iv(year, eq(level))
    Hansen test excluding group:     chi2(84)   = 120.07  Prob > chi2 =  0.006
    Difference (null H = exogenous): chi2(1)    =   0.00  Prob > chi2 =  0.971
Similar results occur when I simply use a standard procedure for a predetermined variable
Code:
gmm(x2, collapse)
So I have two options, either to instrument x2 on itself as I did in Table I andTable II via:
Code:
iv(x2)
Or to use deeper lags following this code

Code:
xtabond2 y l.y l2.y i.x1 x2 x3 x4 year*, gmm(y, laglimits(6 9) collapse) gmm(x4, laglimits(0 0) eq(level) collapse) gmm( x1, laglimits (1 6)) gmm(x2,laglimits(4 6) eq(level) collapse) iv(x3) iv( year*, eq(level)) twostep rob
The specification tests after this code pass again but the coefficent on another variable (i.e., x2)becomes less significant for some reason as can be seen in the following Table IV

Code:
Dynamic panel-data estimation, two-step system GMM
------------------------------------------------------------------------------
Group variable: id                              Number of obs      =     56230
Time variable : year                            Number of groups   =      8009
Number of instruments = 78                      Obs per group: min =         1
Wald chi2(7)  = 303225.28                                      avg =      7.02
Prob > chi2   =     0.000                                      max =        18
------------------------------------------------------------------------------
             |              Corrected
           y |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
           y |
         L1. |   .6855261   .1228667     5.58   0.000     .4447118    .9263404
         L2. |   .1885715   .1139641     1.65   0.098    -.0347939     .411937
             |
        1.x1 |   1.751948   .6706459     2.61   0.009     .4375064     3.06639
          x2 |   .9491019   .3190374     2.97   0.003        .3238    1.574404
          x3 |   5.325703   .7414402     7.18   0.000     3.872507    6.778899
          x4 |   1.965658    1.01822     1.93   0.054    -.0300161    3.961332
        year |   .1390683   .0297333     4.68   0.000     .0807922    .1973444
       _cons |  -278.4076   60.88738    -4.57   0.000    -397.7446   -159.0705
------------------------------------------------------------------------------
Instruments for first differences equation
  Standard
    D.x3
  GMM-type (missing=0, separate instruments for each period unless collapsed)
    L(1/6).x1
    L(6/9).y collapsed
Instruments for levels equation
  Standard
    year
    x3
    _cons
  GMM-type (missing=0, separate instruments for each period unless collapsed)
    DL(4/6).x2 collapsed
    D.x1
    D.x4 collapsed
    DL5.y collapsed
------------------------------------------------------------------------------
Arellano-Bond test for AR(1) in first differences: z =  -3.25  Pr > z =  0.001
Arellano-Bond test for AR(2) in first differences: z =  -0.30  Pr > z =  0.768
------------------------------------------------------------------------------
Sargan test of overid. restrictions: chi2(70)   =  73.89  Prob > chi2 =  0.352
  (Not robust, but not weakened by many instruments.)
Hansen test of overid. restrictions: chi2(70)   =  74.18  Prob > chi2 =  0.344
  (Robust, but weakened by many instruments.)

Difference-in-Hansen tests of exogeneity of instrument subsets:
  GMM instruments for levels
    Hansen test excluding group:     chi2(54)   =  54.35  Prob > chi2 =  0.461
    Difference (null H = exogenous): chi2(16)   =  19.83  Prob > chi2 =  0.228
  gmm(y, collapse lag(6 9))
    Hansen test excluding group:     chi2(65)   =  62.18  Prob > chi2 =  0.576
    Difference (null H = exogenous): chi2(5)    =  12.00  Prob > chi2 =  0.035
  gmm(x4, collapse eq(level) lag(0 0))
    Hansen test excluding group:     chi2(69)   =  74.07  Prob > chi2 =  0.316
    Difference (null H = exogenous): chi2(1)    =   0.11  Prob > chi2 =  0.738
  gmm(x1, lag(1 6))
    Hansen test excluding group:     chi2(4)    =   3.81  Prob > chi2 =  0.432
    Difference (null H = exogenous): chi2(66)   =  70.37  Prob > chi2 =  0.334
  gmm(x2, collapse eq(level) lag(4 6))
    Hansen test excluding group:     chi2(67)   =  73.30  Prob > chi2 =  0.279
    Difference (null H = exogenous): chi2(3)    =   0.88  Prob > chi2 =  0.831
  iv(x3)
    Hansen test excluding group:     chi2(69)   =  73.89  Prob > chi2 =  0.322
    Difference (null H = exogenous): chi2(1)    =   0.29  Prob > chi2 =  0.588
  iv(year, eq(level))
    Hansen test excluding group:     chi2(69)   =  73.70  Prob > chi2 =  0.327
    Difference (null H = exogenous): chi2(1)    =   0.48  Prob > chi2 =  0.488
So, my second question is, since I have the two options, to instrument x2 via the standard procedure or to use deeper lags, which one should I go for?

Please feel free to comment on any asepct of the presented estimation even it is not related to my questions.

looking forward to your feedback
Thank you