Announcement

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

  • xtabond2, differenced dependent variable

    Hello all,

    I wanted to estimate a model with a differenced dependent variable in STATA using the xtabond2 command, as the model is dynamic I would include a first differenced lag of the dependent variable on the right hand side.

    The standard specification and explanations for xtabond only use non-differenced dependent variables, so is it possible to have a differenced dependent variable (plus lags) in xtabond2?
    If yes what would be the correct specification for the gmm?
    gmmstyle(LD.dependent_variable, laglimits (2 .) collapse),
    gmmstyle(L.dependent_variable, laglimits (2 .),
    gmmstyle(L2.dependent_variable, laglimits (2 .)
    or something completely different?

    My dataset is N=30, T=16; which I know is fairly short N & long T for arellano bond estimation but it is the only data available for analysing the question.

    Thank you very much for any comment and help.

  • #2
    Let me first ask: What is your reason for specifying a dynamic model completely in first differences?

    Note the following equivalence:
    \[ y_{it} = \lambda y_{i,t-1} + \beta x_{it} + \alpha_i + u_{it} \]
    \[ \Delta y_{it} = (\lambda - 1) y_{i,t-1} + \beta x_{it} + \alpha_i + u_{it} \]

    The underlying model is the same in both specifications. You can interpret the coefficients \( \beta \) as marginal effects of \( x_{it} \) on the differenced dependent variable \( \Delta y_{it} \) no matter whether you actually estimate the first or the second equation. The valid instruments for the right-hand side variables are the same. You will even get the identical coefficient estimates for \( \beta \).
    https://www.kripfganz.de/stata/

    Comment


    • #3
      Bjoern: xtabond2 takes care of the fixed effect if you enter your variables at level (I assume that the reason you want to difference prior to estimation is to eliminate the fixed effect). Consider the dynamic panel model

      yit = α + γyit-1+ βxit + ηi +uit

      Eliminating the fixed effect ηi by differencing

      Δyi2 = yi2 - yi1= γ(yi1 - yi0)+ β (xi2 - xi1)+ (ui2 - ui1)

      reduces to

      Δyi2 = γΔyi1 + βΔxi2 + Δui2 (Eq. 1)
      __________________________________________________

      In Eq. 1, Δyi1 depends on Δui1 and therefore we cannot condition on the lagged dependent variable when the T dimension is small. Intuitively, the problem arises because of the difficulty in distinguishing between fixed effects and lagged dependence - an individual can have a high value of y either because he has a high fixed effect η or because his values of y were high in the past. With only a few time series observations, one cannot distinguish between these two effects (a large N only increases the number of problematic cases).

      Now, if we were to advance and use your logic of first differencing, then estimating the equation - we can just consider Δyi1 as endogenous and use an estimator such as 2SLS (the example below uses abdata.dta available online)

      Code:
      webuse abdata
      ivregress 2sls D.n (D.nL1= nL2) D.(nL2 w wL1 k kL1 kL2 ys ysL1 ysL2 yr1979 emp yr1980 yr1981 yr1982 yr1983)
      
      Instrumental variables (2SLS) regression               Number of obs =     611
                                                             Wald chi2(16) =  539.01
                                                             Prob > chi2   =  0.0000
                                                             R-squared     =  0.4571
                                                             Root MSE      =  .10581
      
      ------------------------------------------------------------------------------
               D.n |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
               nL1 |
               D1. |   .3498306   .9820426     0.36   0.722    -1.574938    2.274599
                   |
               nL2 |
               D1. |  -.0637868   .0866018    -0.74   0.461    -.2335232    .1059496
                   |
                 w |
               D1. |  -.5473248   .1294125    -4.23   0.000    -.8009686    -.293681
                   |
               wL1 |
               D1. |   .2562104   .5863569     0.44   0.662     -.893028    1.405449
                   |
                 k |
               D1. |    .340475   .0668565     5.09   0.000     .2094387    .4715113
                   |
               kL1 |
               D1. |   .0568763   .3060622     0.19   0.853    -.5429946    .6567472
                   |
               kL2 |
               D1. |   .0165387   .1181213     0.14   0.889    -.2149748    .2480521
                   |
                ys |
               D1. |   .5695901   .2240617     2.54   0.011     .1304373    1.008743
                   |
              ysL1 |
               D1. |   -.506269   .7151837    -0.71   0.479    -1.908003    .8954653
                   |
              ysL2 |
               D1. |   .0277203   .2462848     0.11   0.910    -.4549891    .5104297
                   |
            yr1979 |
               D1. |   .0090343   .0213699     0.42   0.672      -.03285    .0509186
                   |
               emp |
               D1. |   .0160809   .0026665     6.03   0.000     .0108546    .0213072
                   |
            yr1980 |
               D1. |   .0233671   .0297529     0.79   0.432    -.0349476    .0816817
                   |
            yr1981 |
               D1. |    .004924   .0242929     0.20   0.839    -.0426893    .0525372
                   |
            yr1982 |
               D1. |  -.0074509   .0241174    -0.31   0.757    -.0547203    .0398184
                   |
            yr1983 |
               D1. |  -.0099749    .020234    -0.49   0.622    -.0496327    .0296829
                   |
             _cons |  -.0050355   .0129166    -0.39   0.697    -.0303515    .0202806
      ------------------------------------------------------------------------------
      Instrumented:  D.nL1
      Instruments:   D.nL2 D.w D.wL1 D.k D.kL1 D.kL2 D.ys D.ysL1 D.ysL2 D.yr1979
                     D.emp D.yr1980 D.yr1981 D.yr1982 D.yr1983 nL2
      Notice that the first lag of the variable "n" is treated as endogenous and the instrument set is listed at the bottom (all differenced before estimation). The problem with this approach is that once you difference the variables, Δuit may be correlated with Δuit-1 and 2SLS is no longer efficient. Generalized Method of Moments (GMM) estimation addresses this problem and is the basis of the Arellano-Bond estimator. Using xtabond2 and estimating the above model, we need not difference the variables before hand:



      Code:
      xtabond2 n L.n L2.n w L.w L(0/2).(k ys) yr*, gmm(L.n) iv(w L.w L(0/2).(k ys) yr*) nolevel robust
      
      Favoring space over speed. To switch, type or click on mata: mata set matafavor speed, perm.
      yr1976 dropped due to collinearity
      yr1977 dropped due to collinearity
      yr1978 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: id                              Number of obs      =       611
      Time variable : year                            Number of groups   =       140
      Number of instruments = 41                      Obs per group: min =         4
      Wald chi2(16) =   1727.45                                      avg =      4.36
      Prob > chi2   =     0.000                                      max =         6
      ------------------------------------------------------------------------------
                   |               Robust
                 n |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
                 n |
               L1. |   .6862261   .1445943     4.75   0.000     .4028266    .9696257
               L2. |  -.0853582   .0560155    -1.52   0.128    -.1951467    .0244302
                   |
                 w |
               --. |  -.6078208   .1782055    -3.41   0.001    -.9570972   -.2585445
               L1. |   .3926237   .1679931     2.34   0.019     .0633632    .7218842
                   |
                 k |
               --. |   .3568456   .0590203     6.05   0.000      .241168    .4725233
               L1. |  -.0580012   .0731797    -0.79   0.428    -.2014308    .0854284
               L2. |  -.0199475   .0327126    -0.61   0.542    -.0840631    .0441681
                   |
                ys |
               --. |   .6085073   .1725313     3.53   0.000     .2703522    .9466624
               L1. |  -.7111651   .2317163    -3.07   0.002    -1.165321   -.2570095
               L2. |   .1057969   .1412021     0.75   0.454    -.1709542     .382548
                   |
            yr1979 |   .0095545   .0102896     0.93   0.353    -.0106127    .0297217
            yr1980 |   .0220152   .0177104     1.24   0.214    -.0126966     .056727
            yr1981 |  -.0117743   .0295079    -0.40   0.690    -.0696086      .04606
            yr1982 |  -.0270588   .0292751    -0.92   0.355    -.0844369    .0303193
            yr1983 |  -.0213204   .0304599    -0.70   0.484    -.0810207    .0383798
            yr1984 |  -.0077033   .0314106    -0.25   0.806     -.069267    .0538604
      ------------------------------------------------------------------------------
      Instruments for first differences equation
        Standard
          D.(w L.w k L.k L2.k ys L.ys L2.ys yr1976 yr1977 yr1978 yr1979 yr1980
          yr1981 yr1982 yr1983 yr1984)
        GMM-type (missing=0, separate instruments for each period unless collapsed)
          L(1/8).L.n
      ------------------------------------------------------------------------------
      Arellano-Bond test for AR(1) in first differences: z =  -3.60  Pr > z =  0.000
      Arellano-Bond test for AR(2) in first differences: z =  -0.52  Pr > z =  0.606
      ------------------------------------------------------------------------------
      Sargan test of overid. restrictions: chi2(25)   =  67.59  Prob > chi2 =  0.000
        (Not robust, but not weakened by many instruments.)
      Hansen test of overid. restrictions: chi2(25)   =  31.38  Prob > chi2 =  0.177
        (Robust, but weakened by many instruments.)
      
      Difference-in-Hansen tests of exogeneity of instrument subsets:
        iv(w L.w k L.k L2.k ys L.ys L2.ys yr1976 yr1977 yr1978 yr1979 yr1980 yr1981 yr1982 yr1983 yr1984)
          Hansen test excluding group:     chi2(11)   =  12.01  Prob > chi2 =  0.363
          Difference (null H = exogenous): chi2(14)   =  19.37  Prob > chi2 =  0.151

      It may be useful to follow the implementation in the original paper by David Roodman that appears in the Stata Journal - see link below

      http://www.stata-journal.com/sjpdf.h...iclenum=st0159
      Last edited by Andrew Musau; 31 Mar 2015, 09:11.

      Comment


      • #4
        Thank you both very much. This made xtabond2 much clearer to me. I think the specification outlined by Andrew Musau is the one that I should use for estimation.

        Comment

        Working...
        X