Announcement

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

  • Trouble replicating -xtdpd- results using -ivreg2-

    Using Stata 12.1 with -xtdpd- 1.3.1 in official Stata and -ivreg2- 1.0.13 from SSC.
    I believe (perhaps mistakenly?) that I should be able to replicate results from the -xtdpd- command below, using -ivreg2- (or -ivregress-).
    I want to do this in order to take advantage of the weak instrument results reported in by -ivreg2- that are not reported by -xtdpd- (nor -xtabond2-).
    But I cannot even get the point estimates from the two commands to match on my firm investment panel.
    (Note: I've omitted time dummies and other instruments to try to keep this simpler and isolate the problem.)

    Code:
    xtset
    assert !mi(IvLK, Q, CFvLK)
    xtdpd IvLK Q CFvLK, dgmmiv(Q CFvLK, lagrange(2 2)) noconstant twostep vce(robust)
    * the following commands give different point estimates to -xtdpd- above
    * but reportedly use smaller samples (despite having same regressors in main equation and same instruments?)
    * note the fact that -ivregress- and -ivreg2- give the same results suggests this is not an -ivreg2- bug
    ivreg2 D.IvLK (D.Q D.CFvLK=L2.Q L2.CFvLK), gmm2s noconstant cluster(idv)
    ivregress gmm D.IvLK (D.Q D.CFvLK=L2.Q L2.CFvLK), noconstant cluster(idv)
    * now mark the sample used by -ivregress- ...
    cap drop esample_ivregress
    mark esample_ivregress if e(sample)
    * ... and retry -xtdpd- on this restricted sample... but the point estimates are still very different
    xtdpd IvLK Q CFvLK if esample_ivregress, dgmmiv(Q CFvLK, lagrange(2 2)) noconstant twostep vce(robust)
    cap drop esample_xtdpd
    mark esample_xtdpd if e(sample)
    * finally verify the same sample was used
    assert esample_ivregress == esample_xtdpd
    Log files of results attached.



    I can't see why the commands shouldn't give the same point estimates. They have the same regressors and same instruments.
    Clearly I'm missing something (I fear blindingly obvious)... but what?
    Any insights much appreciated.

    Peter
    Attached Files

  • #2
    Hi Peter:
    The used moment conditions differ between xtdpd and ivreg2. The first used GMM-style instruments (diagonal instruments matrix) with moment conditions
    \[
    E [z_{it} u_{it}] = 0 \;\forall t
    \]
    while the latter uses conventional instruments with moment conditions
    \[
    \sum_t E [z_{it} u_{it}] = 0
    \]

    The problem is that xtdpd forces you to specify the option dgmmiv() even though there is actually no econometric necessity to do so. You can, however, replicate the ivreg2 results with xtabond2 by specifying the following:
    Code:
    xtabond2 IvLK Q CFvLK, iv(L2.Q L2.CFvLK, equation(d) passthru) noconstant twostep robust noleveleq
    I hope that helps.
    https://www.kripfganz.de/stata/

    Comment


    • #3
      Bingo! This does indeed give me a match between ivreg2 and xtabond2. Many thanks Sebastian.
      I knew that xtdpd used such moment conditions, and that conventional IV moment conditions are specified as you mention, but I had incorrectly thought that
      ivreg2, gmm2s was using the former (with the 'iv' in the name being a red herring, since ivreg2 can also run OLS and HOLS for example).

      Comment


      • #4
        Peter - very slightly off topic, but the latest version of weakiv supports estimation by xtabond2. This will give you weak-identification-robust test, confidence intervals and confidence sets.

        Comment


        • #5
          Thanks for the pointer Mark.

          Comment

          Working...
          X