Announcement

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

  • The difference between gmm, xtabond2 and xtseqreg

    Hi everyone!!!

    I would like to know more clearance and difference between gmm, xtabond2 and xtseqreg command. What kind of data set conditions I should use appropriate command?
    Code:
    ***GMM example**
     sysuse auto
      regress mpg gear_ratio turn
      gmm (mpg - {b1}*gear_ratio - {b2}*turn - {b0}), instruments(gear_ratio turn)
    
      gmm (mpg - {b1}*gear_ratio - {b2}*turn - {b0}), instruments(gear_ratio turn) derivative(/b1 = -1*gear_ratio) derivative(/b2 = -1*turn) derivative(/b0 = -1)
    
      gmm (mpg - {xb:gear_ratio turn} - {b0}), instruments(gear_ratio turn)
    
      gmm (mpg - {xb:gear_ratio turn} - {b0}), instruments(gear_ratio turn) derivative(/xb = -1) derivative(/b0 = -1)
    
     ivregress 2sls mpg gear_ratio (turn = weight length headroom)
      gmm (mpg - {b1}*turn - {b2}*gear_ratio - {b0}), instruments(gear_ratio weight length headroom) onestep
    
      ivregress gmm mpg gear_ratio (turn = weight length headroom)
      gmm (mpg - {b1}*turn - {b2}*gear_ratio - {b0}), instruments(gear_ratio weight length headroom) wmatrix(robust)
    
    ***xtabond2 Example***
      use http://www.stata-press.com/data/r7/abdata.dta
        xtabond2 n l.n l(0/1).(w k) yr1980-yr1984, gmm(l.n w k) iv(yr1980-yr1984, passthru) noleveleq small
        xtabond2 n l.n l(0/1).(w k) yr1980-yr1984, gmm(l.n w k) iv(yr1980-yr1984, mz) robust twostep small h(2)
        xtabond2 n l(1/2).n l(0/1).w l(0/2).(k ys) yr1980-yr1984, gmm(l.n w k) iv(yr1980-yr1984) robust twostep small
        * Next two are equivalent, assuming id is the panel identifier
        ivreg2 n cap (w = k ys rec) [pw=_n], cluster(id year) orthog(rec)
        xtabond2 n w cap [pw=_n], iv(cap k ys, eq(level)) iv(rec, eq(level)) cluster(id year) h(1)
        * Same for next two
        regress n w k
        xtabond2 n w k, iv(w k, eq(level)) small h(1)
        * And next two, assuming xtabond updated since May 2004 with update command.
        xtabond n yr*, lags(1) pre(w, lags(1,.)) pre(k, endog) robust small noconstant
        xtabond2 n L.n w L.w k yr*, gmm(L.(w n k)) iv(yr*) noleveleq robust small
        * And next two
        xtdpd n L.n L(0/1).(w k) yr1978-yr1984, dgmm(w k n) lgmm(w k n) liv(yr1978-yr1984) vce(robust) two hascons
        xtabond2 n L.n L(0/1).(w k) yr1978-yr1984, gmm(L.(w k n)) iv(yr1978-yr1984, eq(level)) h(2) robust twostep
        * Three ways to reduce the instrument count
        xtabond2 n L.n L(0/1).(w k) yr1978-yr1984, gmm(L.(w k n)) iv(yr1978-yr1984, eq(level)) h(2) robust twostep pca
        xtabond2 n L.n L(0/1).(w k) yr1978-yr1984, gmm(L.(w k n), collapse) iv(yr1978-yr1984, eq(level)) h(2) robust twostep
        xtabond2 n L.n L(0/1).(w k) yr1978-yr1984, gmm(L.(w k n), lag(1 1)) iv(yr1978-yr1984, eq(level)) h(2) robust twostep
        * Estimation a la Hayakawa 2009
        xtabond2 n L.n L(0/1).(w k) yr1979-yr1984, gmm(L.(w k n), lag(1 1) orthog) iv(yr1979-yr1984) h(2) robust twostep orthog noleveleq
    
    ***xtseqreg Example***
    
     webuse psidextract
    
     *** Fit a first-stage model for time-varying indepvars with OLS
     xtseqreg lwage wks south smsa ms exp exp2 occ ind union
    
      ***Fit a second-stage model for time-invariant indepvars with OLS
      xtseqreg lwage (wks south smsa ms exp exp2 occ ind union) fem blk ed

  • #2
    • gmm is a very general command for GMM estimation that allows you to flexibly specify your own moment conditions. It is not specifically targeted at panel data although it has some options that are useful to create "panel-style" instruments. If you have a standard linear (dynamic) panel data model, it is easier to use the official xtabond, xtdpd, xtdpdsys command suite or the community-contributed xtivreg2, xtabond2, xtseqreg, xtdpdgmm commands.
    • xtabond2 is a popular command for linear dynamic panel model estimation with variants of the Arellano-Bond, Arellano-Bover, Blundell-Bond etc. GMM estimators. It has an extended capacity to finetune the estimators compared to the official xtabond, xtdpd, xtdpdsys command suite
    • xtseqreg can do many things that xtabond2 can do (although it is not meant to be a substitute) but it is a command primarily written for the estimation of linear (dynamic) panel models in two sequential stages; see the following Statalist topic for details: XTSEQREG: new Stata command for sequential / two-stage (GMM) estimation of linear panel models.
    • xtdpdgmm is another command for GMM estimation in a linear dynamic panel model that can do many things that xtabond2 can do but specifically allows to easily incorporate nonlinear Ahn-Schmidt moment conditions; see the following Statalist topic for details: XTDPDGMM: new Stata command for efficient GMM estimation of linear (dynamic) panel models with nonlinear moment conditions.
    The gmm command can be tailored to many different problems and data sets. All of the other commands are typically used in the context of short-T / large-N linear (dynamic) panel data models.
    https://www.kripfganz.de/stata/

    Comment


    • #3
      Thank you very
      much
      Sebastian Kripfganz. Your explanation is clear and now I know a new command for me "xtdpdgmm".

      Comment

      Working...
      X