Announcement

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

  • #61
    Thank you so much for your help, Sebastian, when I tried what you suggested the number of instruments in both models do match. The coefficients still differ a little bit, as do the standard errors. I have copied the output below, first for the xtabond2 model, and then for the one using xtseqreg:
    Code:
    . xtabond2 lnlabprod_v3 capprod rawprod npprod dummy maxprod i.Year if (q13a ==1 & q11a == 0 & industry_same ==1), gmm (l
    > nlabprod_v3 capprod rawprod npprod dummy maxprod, lag(2 2) eq(level)) gmm (lnlabprod_v3 capprod rawprod npprod dummy ma
    > xprod, lag(2 2) eq(diff)) iv(i.Year i.q17a, eq(level)) iv(i.q17a, eq(diff)) robust twostep
    Favoring speed over space. To switch, type or click on mata: mata set matafavor space, perm.
    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: q1                              Number of obs      =      5612
    Time variable : time                            Number of groups   =      2982
    Number of instruments = 44                      Obs per group: min =         1
    Wald chi2(8)  =  16799.40                                      avg =      1.88
    Prob > chi2   =     0.000                                      max =         3
    ------------------------------------------------------------------------------
                 |              Corrected
    lnlabprod_v3 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
         capprod |   .1737902    .068021     2.55   0.011     .0404714     .307109
         rawprod |   .0695543   .0560353     1.24   0.215    -.0402729    .1793815
          npprod |   .2612364   .1383583     1.89   0.059    -.0099408    .5324136
           dummy |    3.12106   1.320894     2.36   0.018     .5321542    5.709965
         maxprod |   .4540816    .180837     2.51   0.012     .0996476    .8085157
                 |
            Year |
           2011  |          0  (empty)
           2013  |  -4.680937    .047691   -98.15   0.000    -4.774409   -4.587464
           2015  |  -4.759981    .054865   -86.76   0.000    -4.867515   -4.652448
                 |
           _cons |   10.94667   1.147688     9.54   0.000     8.697245     13.1961
    ------------------------------------------------------------------------------
    Instruments for first differences equation
      Standard
        D.(0b.q17a 1.q17a 2.q17a 3.q17a 4.q17a 5.q17a 6.q17a 7.q17a 8.q17a 9.q17a
        10.q17a 11.q17a 12.q17a 13.q17a 14.q17a 15.q17a 16.q17a 17.q17a 18.q17a
        19.q17a 20.q17a)
      GMM-type (missing=0, separate instruments for each period unless collapsed)
        L2.(lnlabprod_v3 capprod rawprod npprod dummy maxprod)
    Instruments for levels equation
      Standard
        2011b.Year 2013.Year 2015.Year 0b.q17a 1.q17a 2.q17a 3.q17a 4.q17a 5.q17a
        6.q17a 7.q17a 8.q17a 9.q17a 10.q17a 11.q17a 12.q17a 13.q17a 14.q17a
        15.q17a 16.q17a 17.q17a 18.q17a 19.q17a 20.q17a
        _cons
      GMM-type (missing=0, separate instruments for each period unless collapsed)
        DL2.(lnlabprod_v3 capprod rawprod npprod dummy maxprod)
    ------------------------------------------------------------------------------
    Arellano-Bond test for AR(1) in first differences: z =  -5.90  Pr > z =  0.000
    Arellano-Bond test for AR(2) in first differences: z =      .  Pr > z =      .
    ------------------------------------------------------------------------------
    Sargan test of overid. restrictions: chi2(35)   =  75.26  Prob > chi2 =  0.000
      (Not robust, but not weakened by many instruments.)
    Hansen test of overid. restrictions: chi2(35)   =  38.54  Prob > chi2 =  0.312
      (Robust, but weakened by many instruments.)
    
    Difference-in-Hansen tests of exogeneity of instrument subsets:
      gmm(lnlabprod_v3 capprod rawprod npprod dummy maxprod, eq(diff) lag(2 2))
        Hansen test excluding group:     chi2(29)   =  30.33  Prob > chi2 =  0.397
        Difference (null H = exogenous): chi2(6)    =   8.21  Prob > chi2 =  0.223
      iv(2011b.Year 2013.Year 2015.Year 0b.q17a 1.q17a 2.q17a 3.q17a 4.q17a 5.q17a 6.q17a 7.q17a 8.q17a 9.q17a 10.q17a 11.q17
    > a 12.q17a 13.q17a 14.q17a 15.q17a 16.q17a 17.q17a 18.q17a 19.q17a 20.q17a, eq(level))
        Hansen test excluding group:     chi2(16)   =  10.85  Prob > chi2 =  0.818
        Difference (null H = exogenous): chi2(19)   =  27.69  Prob > chi2 =  0.090
      iv(0b.q17a 1.q17a 2.q17a 3.q17a 4.q17a 5.q17a 6.q17a 7.q17a 8.q17a 9.q17a 10.q17a 11.q17a 12.q17a 13.q17a 14.q17a 15.q1
    > 7a 16.q17a 17.q17a 18.q17a 19.q17a 20.q17a, eq(diff))
        Hansen test excluding group:     chi2(17)   =  23.73  Prob > chi2 =  0.127
        Difference (null H = exogenous): chi2(18)   =  14.81  Prob > chi2 =  0.675

    Code:
    . xi: xtseqreg lnlabprod_v3 capprod rawprod npprod dummy maxprod if (q13a == 1 & q11a == 0 & industry_same ==1), gmmiv (lnlabprod_v3 
    > capprod rawprod npprod dummy maxprod, difference lag (2 2) model(level)) gmmiv (lnlabprod_v3 capprod rawprod npprod dummy maxprod, 
    > lag (2 2) model(diff)) iv(i.Year i.q17a, model(level)) iv(i.q17a, difference model(diff)) teffects vce(robust) twostep
    i.Year            _IYear_2011-2015    (naturally coded; _IYear_2011 omitted)
    i.q17a            _Iq17a_0-20         (naturally coded; _Iq17a_0 omitted)
    
    Group variable: q1                           Number of obs         =      5612
    Time variable: time                          Number of groups      =      2982
    
                                                 Obs per group:    min =         1
                                                                   avg =  1.881958
                                                                   max =         3
    
                                                 Number of instruments =        44
    
                                         (Std. Err. adjusted for clustering on q1)
    ------------------------------------------------------------------------------
                 |              WC-Robust
    lnlabprod_v3 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
         capprod |   .1741671   .0782445     2.23   0.026     .0208108    .3275235
         rawprod |   .0798184   .0682943     1.17   0.243    -.0540359    .2136727
          npprod |   .2987752   .1829994     1.63   0.103     -.059897    .6574473
           dummy |   2.759078   1.883417     1.46   0.143    -.9323524    6.450508
         maxprod |   .4073506   .2404929     1.69   0.090    -.0640069    .8787081
                 |
            time |
              2  |  -4.669761   .0486313   -96.02   0.000    -4.765077   -4.574445
              3  |  -4.751412   .0601527   -78.99   0.000    -4.869309   -4.633514
                 |
           _cons |   11.26951   1.337084     8.43   0.000     8.648873    13.89015
    ------------------------------------------------------------------------------
    Am I missing out on specifying something else as well?

    Thank you for your help, again!

    Suchita

    Comment


    • #62
      Without seeing your data set (or a data example that can be used to replicate the results; see the FAQ #12.2), there is not much I can say anymore.

      I wonder if it has something to do with the time dummies. With xtabond2, you are using the variable Year to specify time dummies. From xtseqreg, it is evident that the time identifier in your data set is a variable with name time. You might replace Year by time to see if that changes anything. (Also, you do not need to specify the time dummies explicitly as iv() instruments in the xtseqreg command because that is taken care of by the teffects option.)
      https://twitter.com/Kripfganz

      Comment


      • #63
        Thanks Sebastian, I have provided a data example here, along with the two commands that I used. I tried using the same time variable with both commands (i.time), but the coefficients were still different across both models. I am not sure whether 100 observations using dataex are enough to run these commands, so if it's easier, I can send you the data by email.

        ----------------------- copy starting from the next line -----------------------
        Code:
        * Example generated by -dataex-. To install: ssc install dataex
        clear
        input float(lnlabprod_v3 capprod rawprod npprod dummy maxprod) double q1 float time byte q17a
         15.51579  17.90249   3.762741   .8472978 0  5.649166   4 1 11
         12.52581  19.33049   3.569072  .22314355 0  5.736572   4 2 11
        13.455138 18.214764   4.053751  .51082563 0  6.024254   4 3 11
        16.809893 17.891441  4.4543676  -.1541507 1         0   5 1  7
        12.011182 18.537262   4.636079  -.4054651 1         0   5 2  7
        12.247718  18.49787  4.5157866  -.4054651 1         0   5 3  7
         17.14419 19.780193  4.0069385   .2006707 0  7.929407  14 1  1
        13.052557 19.405527   2.557471  -1.011601 0  7.968868  14 2  1
        16.488367 17.717089  3.2084305  .22314355 0  5.521461  24 1 14
        12.949127 17.384583   5.109517   .6931472 0  5.809143  24 2 14
        13.029373  15.74103   5.370202   .6931472 0  5.809143  24 3 14
        11.066833 15.669784  2.2219982  -1.609438 1         0  39 2  6
        12.224422 16.993793    2.84181  -.6931472 1         0  39 3  6
         11.82922  15.36968   3.001088  -.6931472 1         0  76 2 11
        15.884507 17.311623  1.8866746 -.51082563 0  5.393628 127 1 10
        12.880795 18.037169   3.689075   .6931472 0  6.309918 127 2 10
        11.650903  16.89371   .9666691 -1.3862944 0  4.968032 127 3 10
         16.59972 18.185354  4.1961803  -.6931472 0   4.04776 139 1 11
        15.807546 16.723837  2.2151787  .51082563 0  6.582333 150 1  4
         9.987182 16.557903  1.8950953  -.5753642 0  7.103515 150 2  4
         12.87883 14.265123   3.077447  -.8472978 0  5.619002 150 3  4
                .         .          .          . 1         . 154 1 19
        17.239052 16.954948  1.1935275   .3364722 0  8.540022 158 1  1
         11.46902 16.741585  3.6772854   .8873032 0 10.245725 158 2  1
         10.30345 15.549974  2.0089011  -2.036882 0  9.056141 158 3  1
        16.605898 17.891441   2.466493 -.24116206 0  4.961845 182 1 11
        11.074664 17.289272   3.453559  -.4519851 0  5.203007 182 2 11
        12.967273 17.861294  3.8226395  -.4054651 0  5.512675 182 3 11
        17.790726  17.85322    3.34092  .22314355 0  5.849783 227 1 14
        13.249415 17.672264  1.3718473  -.5877867 0  5.020147 227 2 14
         11.95906 16.539537    2.03088  -.5877867 0  6.255168 227 3 14
         11.77936 16.873756   2.940463  .51082563 1         0 256 2  3
        11.419157 16.059484  .25154305 -2.0794415 1         0 256 3  3
        16.034891  15.92533   .9571387  -.5465437 0  5.874684 340 1 18
        13.497252 17.511215   4.667684   .8109302 0  6.490047 340 2 18
        12.780745 16.873756  4.7322226 -1.0986123 0  5.264416 341 2 18
         12.01133 16.434177   2.148663  .22314355 0  4.976734 341 3 18
        15.810666 14.826716   1.704353 -1.0986123 0  4.168206 351 1  6
        11.685787 16.979116   2.825333 -1.0986123 0 4.3609734 351 2  6
        12.071953 17.062786   2.618667  -.6931472 0 4.7664385 351 3  6
        17.461563 16.087849   .7806823  -1.734601 0  2.831953 352 1 18
        12.461958 17.384583   3.569072  -.2876821 0 4.4716387 352 2 18
         12.08032 16.790852  2.2821944  -1.252763 0  3.912023 352 3 18
        16.068707  15.04986   2.883008 -1.7917595 0  4.492446 355 1 18
         12.57165 17.384583   3.345928          0 0  4.867535 355 2 18
         15.90001 16.330793   1.128989 -1.3862944 0  6.802395 357 1  6
        12.090895 15.775145  .06251392          0 0  8.021394 357 2  6
        11.650678 15.453348  1.5200543 -1.0986123 0  7.615929 357 3  6
        15.477478         . -.19276685  .18232156 0 3.2084305 364 1  3
        10.988482 12.086265    -.26912 -1.3862944 0  3.624341 364 2  3
         14.27173         . -1.8022047  -3.218876 0 1.1935276 365 1  3
        12.504975 14.032175  1.2664868  2.3272777 0  3.912023 365 2  3
         12.01133  13.99806  1.2323723  1.3862944 0  3.912023 365 3  3
        14.603573 13.622744  -1.291379 -1.0986123 0  5.453857 366 1  6
         9.232033 14.858853  -.3429512          0 0  6.745236 366 2  6
        10.570226  15.74103  2.7728174 -1.0986123 0  5.646624 366 3  6
        14.861118 13.622744   .7235239  -.6931472 1         0 368 1  6
        10.882292 16.691435   1.959634  -.6931472 1         0 368 2  6
         9.303278  16.65732   2.148663 -1.3862944 1         0 368 3  6
        17.283094 16.667267   .7235239 -1.3862944 0  5.521461 369 1  6
        13.050965 15.839683  2.4704595 -1.0986123 0  5.809143 369 2  6
        11.823995 16.588327   1.743198  .51082563 0  5.512675 369 3  6
        17.098843 15.588857  1.6302452  -.8472978 0  5.462225 379 1 18
        15.596825 14.721356  -.4159104  -1.609438 0   4.18926 380 1 18
        12.088263 15.775145  2.2440608 -1.3862944 0 4.6051702 380 2 18
        11.704954 16.251856   2.436345  -.4054651 0  4.892852 380 3 18
        15.271315  14.22058   .4050702  -1.704748 0  3.623946 382 1  6
         16.23363   15.1144   .8288844 -1.5040774 0  4.517764 386 1 18
        11.364718  16.33476  1.6171436  -.6931472 0  3.912023 386 2 18
        12.988244 17.350468    2.84181  1.0986123 0  5.521461 386 3 18
                . 15.009038          .          0 1         0 394 1  6
        11.980905 17.721054   1.959634          0 1         0 394 2  6
        10.742817 16.300646   .5392251 -1.3862944 1         0 394 3  6
        16.467653         .  2.1098182  1.7917595 0  7.600903 398 1  3
        10.519887 12.779412   1.219395 -1.3862944 0  6.328561 398 2  3
        10.485772 13.438445  1.0092287  -1.609438 0  6.105417 398 3  3
        15.590855         .   .7235239 -1.3862944 0  2.466493 399 1  3
         10.71182 10.476827 .005943624  -.6931472 0  2.995732 399 2  3
         15.26213         .  .14370544   .4700036 1         0 404 1  3
        10.959253  13.47256   .7721904  -.6931472 1         0 404 2  3
         11.99875 13.438445  1.6378374          0 1         0 404 3  3
        16.148472 15.232182   1.691108  -2.944439 0  5.274627 408 1 18
        11.706133 16.369638   1.791988 -1.3862944 0  7.025538 408 3 18
        16.793829 14.739705  1.5220315 -2.1972246 0  3.719256 409 1 18
        13.123002  18.23188   4.082394   .2876821 0  5.703783 409 2 18
        11.361223 15.153243   .9810579 -2.1972246 0  3.912023 409 3 18
        15.632634   14.9445   -.885914 -1.3862944 0  5.511016 412 1  6
        11.575506 17.161438   2.652781  -.9162908 0  5.480639 412 2  6
        14.660428 18.043615   4.921252    4.59512 0  7.090077 412 3  6
         12.38117   17.0969   1.959634          0 1         0 413 2  6
        11.487482  15.58688  1.0782216   -1.94591 1         0 413 3  6
        16.426104  15.92533  1.1935276  -.6931472 0  6.321072 415 1  6
         12.77922 16.468292   .7556611   .6931472 0  7.777318 415 2  6
                .         .          .          . 0         . 415 3  6
         16.49941   16.5566  1.0599961   .6931472 0  5.442023 416 1  6
         10.79337 13.438445  2.3309846          0 0  5.634789 416 3  6
        16.988522 17.717089  3.4961126  -1.609438 0  6.646052 527 1 14
        11.488791 17.684687  1.2664868  -.6931472 0  7.726912 527 2 14
        11.031332 16.381567 -1.2327317  -.6931472 0  7.573534 527 3 14
        17.216667  19.80689   2.697605          0 0  8.699514 532 1 15
        end
        label values q17a r17_11
        label def r17_11 1 "Food and beverages", modify
        label def r17_11 3 "Textiles", modify
        label def r17_11 4 "Apparel", modify
        label def r17_11 6 "Wood", modify
        label def r17_11 7 "Paper", modify
        label def r17_11 10 "Chemical products etc.", modify
        label def r17_11 11 "Rubber", modify
        label def r17_11 14 "Fabricated metal products", modify
        label def r17_11 15 "Electronic machinery, computers, radio, tv, etc.", modify
        label def r17_11 18 "Furniture, jewellery, music equipment, watches, toys and medical equipment", modify
        label def r17_11 19 "Recycling etc.", modify


        Code:
        . xtset q1 time
               panel variable:  q1 (unbalanced)
                time variable:  time, 1 to 3, but with gaps
                        delta:  1 unit
        Code:
        . xtabond2 lnlabprod_v3 capprod rawprod npprod dummy maxprod i.time, gmm (lnlabprod_v3 capprod rawprod npprod dummy maxprod, lag(2 2) eq(level)) gmm (lnlabprod_v3 capprod rawprod npprod dummy maxprod, lag(2 2) eq(diff)) iv(i.time i.q17a, eq(level)) iv(i.q17a, eq(diff)) robust twostep

        Code:
        . xi: xtseqreg lnlabprod_v3 capprod rawprod npprod dummy maxprod, gmmiv (lnlabprod_v3 capprod rawprod npprod dummy maxprod, difference lag (2 2) model(level)) gmmiv (lnlabprod_v3 capprod rawprod npprod dummy maxprod, lag (2 2) model(diff)) iv(i.q17a, model(level)) iv(i.q17a, difference model(diff)) teffects vce(robust) twostep

        Comment


        • #64
          With your data example, both commands deliver identical output on my computer. Please feel free to send me the data set by e-mail.
          https://twitter.com/Kripfganz

          Comment


          • #65
            Thank you Sebastian, I sent you an email.

            Comment


            • #66
              Thanks. That's really odd. I cannot tell exactly what is going on here but I can at least provide some suggestive evidence that there is a bug in xtabond2. Consider the following extremely simplified regression based on your data set, where the dependent variable is just regressed on a constant. I still add some dummy variables as instruments. However, in theory, these dummy variables do not have any effect on the constant because the constant is perfectly identified without these dummy variables. Hence, this regression is essentially just an OLS regression of the dependent variable on the constant. As you can see below, the OLS results from regress are indeed identical to xtseqreg while those from xtabond2 differ (while they should not):
              Code:
              . xtabond2 lnlabprod_v3 if (q13a ==1 & q11a == 0 & industry_same ==1), iv(i.q17a, eq(diff)) robust nodi
              Favoring speed over space. To switch, type or click on mata: mata set matafavor space, perm.
              Warning: Two-step estimated covariance matrix of moments is singular.
                Using a generalized inverse to calculate robust weighting matrix for Hansen test.
              
              Dynamic panel-data estimation, one-step system GMM
              ------------------------------------------------------------------------------
              Group variable: q1                              Number of obs      =      6094
              Time variable : time                            Number of groups   =      3112
              Number of instruments = 19                      Obs per group: min =         1
              Wald chi2(0)  =         .                                      avg =      1.96
              Prob > chi2   =         .                                      max =         3
              ------------------------------------------------------------------------------
                           |               Robust
              lnlabprod_v3 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                     _cons |   13.69559   .0258224   530.38   0.000     13.64498     13.7462
              ------------------------------------------------------------------------------
              Instruments for first differences equation
                Standard
                  D.(0b.q17a 1.q17a 2.q17a 3.q17a 4.q17a 5.q17a 6.q17a 7.q17a 8.q17a 9.q17a
                  10.q17a 11.q17a 12.q17a 13.q17a 14.q17a 15.q17a 16.q17a 17.q17a 18.q17a
                  19.q17a 20.q17a)
              Instruments for levels equation
                Standard
                  _cons
              ------------------------------------------------------------------------------
              Arellano-Bond test for AR(1) in first differences: z =  -5.88  Pr > z =  0.000
              Arellano-Bond test for AR(2) in first differences: z =      .  Pr > z =      .
              ------------------------------------------------------------------------------
              Sargan test of overid. restrictions: chi2(18)   =  24.97  Prob > chi2 =  0.126
                (Not robust, but not weakened by many instruments.)
              Hansen test of overid. restrictions: chi2(18)   =  18.71  Prob > chi2 =  0.410
                (Robust, but weakened by many instruments.)
              
              . xi: xtseqreg lnlabprod_v3 if (q13a == 1 & q11a == 0 & industry_same ==1), iv(i.q17a, diff m(diff)) vce(robust)
              i.q17a            _Iq17a_0-20         (naturally coded; _Iq17a_0 omitted)
              
              Group variable: q1                           Number of obs         =      6094
              Time variable: time                          Number of groups      =      3112
              
                                                           Obs per group:    min =         1
                                                                             avg =  1.958226
                                                                             max =         3
              
                                                           Number of instruments =        19
              
                                               (Std. Err. adjusted for 3,112 clusters in q1)
              ------------------------------------------------------------------------------
                           |               Robust
              lnlabprod_v3 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                     _cons |   13.69021   .0259178   528.22   0.000     13.63941      13.741
              ------------------------------------------------------------------------------
              
              . reg lnlabprod_v3 if (q13a == 1 & q11a == 0 & industry_same ==1), vce(cluster q1)
              
              Linear regression                               Number of obs     =      6,094
                                                              F(0, 3111)        =       0.00
                                                              Prob > F          =          .
                                                              R-squared         =     0.0000
                                                              Root MSE          =     2.4716
              
                                               (Std. Err. adjusted for 3,112 clusters in q1)
              ------------------------------------------------------------------------------
                           |               Robust
              lnlabprod_v3 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                     _cons |   13.69021    .025922   528.13   0.000     13.63938    13.74103
              ------------------------------------------------------------------------------
              I hope this convinces you that you can move forward with xtseqreg in your analysis.
              https://twitter.com/Kripfganz

              Comment


              • #67
                Thank you for this example, Sebastian, it is very strange that this happens. In this case, the coefficient are the same to the second decimal place, which might work, at least for some cases.

                Thanks for taking your time to clarify this, and answer my question! Much appreciated!

                Comment


                • #68
                  Dear all,

                  I apologize if I post this question here, I am not sure where exactly I should post my questions.
                  I want to estimate the dynamic effect of schooling years on log of hourly wage (dynamic mincer equation). The key variable in this estimation is schooling years (s) and it is endogenous and time-invariant. In the model all variables considered endogenous except year dummies.
                  The variables are:
                  logw: logarithm of hourly wage
                  s: schooling years
                  pexper: potential experience
                  pexper2: potential experience square

                  years are from 2005-2010, I just used the dummy years from 2007-2010.

                  Since schooling years is time-invariant and endogenous. It is not possible to use lag of schooling years as instrument for the difference equation (bc in the difference equation, schooling years disappears since it is time- invariant). Furthermore, in the level equation, it is also impossible to use lag of its difference as instrument.

                  I searched a lot and found that the solution would be by using xtabond2 or xtseqreg or xdpdgmm. My question is if I want to use internal instrument not external, for schooling years, how this can be applied using xtabond2. I used the following code, however I am not sure if it gives a correct coefficient for schooling years.

                  xtabond2 logw laglogw s pexper pexper2 yr2007-yr2010 if sex==1, gmm (logw pexper pexper2 , lag(2 .) eq(diff) collapse ) gmm(logw , lag(1 1) eq(level) collapse) iv(yr2007-yr2010, equation(level)) small robust two

                  Comment


                  • #69
                    Using system GMM is not a panacea for the identification of coefficients of endogenous time-invariant regressors. You are obtaining a spurious estimate because the instruments for the level equation are somewhat correlated with the time-invariant regressor in finite samples. However, the usual assumption is that those instruments are (asymptotically) uncorrelated with all time-invariant variables. Hence, identification fails.

                    If all your variables are endogenous (in particular, if all of them are allowed to be correlated with the unobserved time-invariant heterogeneity), then there is no hope to consistently estimate the coefficient of the observed endogenous time-invariant variable. You need to find valid external instruments.

                    For more information, please see slides 82 to 86 of my presentation at this year's London Stata Conference, and my recent article in the Journal of Applied Econometrics:
                    https://twitter.com/Kripfganz

                    Comment


                    • #70
                      Please Professor Kripfganz, is there an option for other data transformation types in xtseqreg command aside using first difference? I am new to the stata forum, so not sure if this is the right way to ask my question.

                      Thank you.

                      Comment


                      • #71
                        The xtseqreg command currently only supports the first-difference transformation of the model. However, if you need another transformation in the first stage of the procedure, e.g. forward-orthogonal deviations instead of first differences, you can use my xtdpdgmm command for that purpose:
                        Code:
                        . webuse psidextract
                        . xtdpdgmm lwage L.lwage wks exp exp2, model(fod) gmmiv(L.lwage wks exp exp2, lag(1 4)) twostep vce(robust) auxiliary
                        . xtseqreg lwage (L.lwage wks exp exp2) fem ed blk, first(, copy) iv(fem ed blk, model(level)) vce(robust)
                        Note that you need to specify the auxiliary option with xtdpdgmm and the first(, copy) option for xtseqreg for the combination of these two commands to work.
                        https://twitter.com/Kripfganz

                        Comment


                        • #72
                          Thank you Prof Kripfganz for the clarifications. My attempt to run the two stage estimation using xtdpdgmm in the first stage and xtseqreg commands in the second stage returns an error message, "option first( ) incorrectly specified". This is similar to what was reported in post #26 of this thread. I followed your recommendations in post #29 and post #57 that links to the detailed explanations that you gave on how to run xtdpdgmm, but still get the same error message repeatedly.

                          My panel data set is unbalanced with long T=47, N=2397, n=51, and i am using stata 13.1 for the analysis. My interest in the two stage sysGMM approach is because of the time invariant variables in my model, and i think using the FOD-GMM over first diff estimator will serve my interest most, which rules out the use of xtseqreg in the first stage. Do you think there is something i could do differently that addresses the error problem? I am considering the one stage sys-GMM since my variables are properly classified as exogenous, predetermined & endogenous. How does this work with the time invariant variables? Would i need to interact them with time dummies for their coefficients to be estimated? What other options do i have in using your recommended estimation methods?

                          Thank you so much for your time.

                          Comment


                          • #73
                            I am afraid I would need to see the exact code (and ideally also the first-stage output) that you used to figure out what might have caused this error message.

                            If you classify your time-invariant variables as exogenous (with regard to the unit-specific effects), you can use a one-stage system-GMM approach and just instrument those variables by themselves in levels. Interactions with time dummies are possible but their effects are interpreted differently, as these are relative effects to the omitted base year, but the base effect would still not be estimated.
                            https://twitter.com/Kripfganz

                            Comment


                            • #74
                              The new version 1.2.3 of the xtseqreg package is now available on SSC - with the usual thanks to Kit Baum - and on my personal website.
                              Code:
                              adoupdate xtseqreg, update
                              With this update, I primarily fixed a bug in the determination of the estimation sample when the sample was restricted with an if-condition. See the following discussion for details:
                              https://www.statalist.org/forums/for...ferences-model
                              https://twitter.com/Kripfganz

                              Comment


                              • #75
                                Dear Statalisters,

                                I am using the command xtseqreg in my research.

                                My data set is characterized by a large (N aproximately equal to 130 000) and small T (year 2000 to 2017) when compared to N. Additionally, I have a set of time-varying independent variables (ln_pub_c1 ln_pub_c2 ln_icts ln_dhdi ln_dwgi ln_dspc ln_dtop10 ln_dneig) and time-invariant variables (ln_distcap ln_contig ln_comlang_off ln_colony ln_comcol). My dependent variable is ln_pub_col.

                                I have tried the diff-GMM and system-GMM specification and followed the sequential selection process adapted from Kiviet (2019,) as explained by Sebastian Kripfganz in his presentation at London Stata Conference in 2019.

                                As an example, I show the code used in one of the specifications and the obtained output.

                                HTML Code:
                                xtseqreg L(0/3).ln_pub_col L(0/3).(ln_pub_c1 ln_pub_c2 ln_icts ln_dhdi ln_dwgi ln_dspc ln_dtop10 ln_dneig), gmmiv(ln_pub_col, model(difference) lagrange(2 .)) gmmiv(ln_pub_col, model(level) difference lagrange(1 .)) gmmiv(ln_pub_c1 ln_pub_c2 ln_icts ln_dhdi ln_dwgi ln_dspc ln_dtop10 ln_dneig, model(difference) lagrange(2 .)) gmmiv(ln_pub_c1 ln_pub_c2 ln_icts ln_dhdi ln_dwgi ln_dspc ln_dtop10 ln_dneig, model(level) difference lagrange(1 .)) twostep vce(robust) teffects
                                
                                Group variable: pair_n                       Number of obs         =    110764
                                Time variable: year                          Number of groups      =      8372
                                
                                                                             Obs per group:    min =         1
                                                                                               avg =  13.23029
                                                                                               max =        15
                                
                                                                             Number of instruments =      2266
                                
                                                             (Std. Err. adjusted for 8,372 clusters in pair_n)
                                ------------------------------------------------------------------------------
                                             |              WC-Robust
                                  ln_pub_col |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                                -------------+----------------------------------------------------------------
                                  ln_pub_col |
                                         L1. |   .4688867   .0063557    73.77   0.000     .4564297    .4813436
                                         L2. |   .2857157   .0072898    39.19   0.000     .2714279    .3000035
                                         L3. |   .2246439   .0064371    34.90   0.000     .2120273    .2372605
                                             |
                                   ln_pub_c1 |
                                         --. |  -.0027787   .0067151    -0.41   0.679    -.0159401    .0103827
                                         L1. |  -.0046365   .0046309    -1.00   0.317    -.0137129    .0044399
                                         L2. |   .0124372   .0039266     3.17   0.002     .0047412    .0201332
                                         L3. |  -.0027408   .0037742    -0.73   0.468    -.0101381    .0046565
                                             |
                                   ln_pub_c2 |
                                         --. |  -.0253773   .0059413    -4.27   0.000    -.0370221   -.0137325
                                         L1. |   .0097872   .0043259     2.26   0.024     .0013086    .0182657
                                         L2. |   .0116265   .0037105     3.13   0.002     .0043541     .018899
                                         L3. |   .0096613   .0033984     2.84   0.004     .0030006     .016322
                                             |
                                     ln_icts |
                                         --. |   .0001502   .0109222     0.01   0.989    -.0212568    .0215573
                                         L1. |  -.0197857   .0112639    -1.76   0.079    -.0418626    .0022911
                                         L2. |  -.0008872   .0068086    -0.13   0.896    -.0142318    .0124574
                                         L3. |   .0079444   .0050573     1.57   0.116    -.0019677    .0178565
                                             |
                                     ln_dhdi |
                                         --. |   .0515274   .3173365     0.16   0.871    -.5704408    .6734956
                                         L1. |  -.2789475    .412341    -0.68   0.499    -1.087121     .529226
                                         L2. |   .4715926   .2849979     1.65   0.098     -.086993    1.030178
                                         L3. |  -.3044555   .1959573    -1.55   0.120    -.6885248    .0796138
                                             |
                                     ln_dwgi |
                                         --. |   .0627715   .0237404     2.64   0.008     .0162412    .1093018
                                         L1. |  -.0416349   .0228634    -1.82   0.069    -.0864464    .0031766
                                         L2. |   .0023067   .0135162     0.17   0.864    -.0241846     .028798
                                         L3. |   .0129192   .0094862     1.36   0.173    -.0056733    .0315118
                                             |
                                     ln_dspc |
                                         --. |   .0098149   .0047202     2.08   0.038     .0005635    .0190663
                                         L1. |    .006029   .0030625     1.97   0.049     .0000265    .0120314
                                         L2. |   .0115451   .0030407     3.80   0.000     .0055854    .0175047
                                         L3. |   .0034157   .0029659     1.15   0.249    -.0023974    .0092289
                                             |
                                   ln_dtop10 |
                                         --. |   .0208839   .0030799     6.78   0.000     .0148473    .0269205
                                         L1. |   .0088835   .0017673     5.03   0.000     .0054198    .0123473
                                         L2. |  -.0003043   .0017246    -0.18   0.860    -.0036845     .003076
                                         L3. |   .0062354    .001771     3.52   0.000     .0027643    .0097064
                                             |
                                    ln_dneig |
                                         --. |  -2.427052   .0530159   -45.78   0.000    -2.530961   -2.323143
                                         L1. |   .7764577   .0392983    19.76   0.000     .6994344    .8534809
                                         L2. |   .4338752   .0387189    11.21   0.000     .3579875    .5097629
                                         L3. |   .3515533   .0376412     9.34   0.000     .2777778    .4253288
                                             |
                                        year |
                                       2004  |  -.0049636   .0049394    -1.00   0.315    -.0146446    .0047175
                                       2005  |   .0017011   .0053225     0.32   0.749    -.0087308     .012133
                                       2006  |  -.0053781   .0057684    -0.93   0.351    -.0166839    .0059277
                                       2007  |    .007022   .0056924     1.23   0.217    -.0041349    .0181789
                                       2008  |  -.0036337   .0053883    -0.67   0.500    -.0141946    .0069272
                                       2009  |    .001857   .0058449     0.32   0.751    -.0095987    .0133127
                                       2010  |  -.0038453   .0057092    -0.67   0.501    -.0150352    .0073446
                                       2011  |   .0010227   .0058642     0.17   0.862     -.010471    .0125164
                                       2012  |  -.0052501   .0061473    -0.85   0.393    -.0172985    .0067983
                                       2013  |  -.0173922   .0062736    -2.77   0.006    -.0296883   -.0050962
                                       2014  |   -.007815   .0066605    -1.17   0.241    -.0208694    .0052393
                                       2015  |   .0108063   .0069097     1.56   0.118    -.0027364     .024349
                                       2016  |   .0111071   .0073656     1.51   0.132    -.0033291    .0255433
                                       2017  |  -.0446102   .0077037    -5.79   0.000    -.0597092   -.0295112
                                             |
                                       _cons |   .2825371   .0291722     9.69   0.000     .2253607    .3397135
                                ------------------------------------------------------------------------------
                                
                                . estat serial
                                
                                Arellano-Bond test for autocorrelation of the first-differenced residuals
                                H0: no autocorrelation of order 1:     z =  -55.4828   Prob > |z|  =    0.0000
                                H0: no autocorrelation of order 2:     z =    6.0365   Prob > |z|  =    0.0000
                                However, I found the same behaviour in all the specifications I have tried: the Arellano-Bond test for the second order is always rejected. To overcome this issue, I used the collapse option, reduced the number of lags of the instruments and also considered the nonlinear Ahn and Schmidt (1995) moment conditions. I also tried to include in the model different lags for both dependent and independent variables. Still, in all cases, the test continues to be rejected.

                                Comments and help regarding these results are very welcome.

                                Thanks in advance.

                                Kiviet, J. F. (2019). Microeconometric dynamic panel data methods: Model specification and selection issues. MPRA Paper 95159, Munich Personal RePEc Archive.

                                Ahn, S. C., and P. Schmidt (1995). Efficient estimation of models for dynamic panel data. Journal of Econometrics 68 (1): 5–27





                                Comment

                                Working...
                                X