Announcement

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

  • xtdpd doesn't run with 3 periods of data? But xtadon2 does

    Dear all,

    I am trying to understand the difference between xtdpd and xtabond2. I understood there could be small differences in terms of standard error. But why does xtdpd doesn't run with 3 periods of data?

    webuse abdata, clear
    xtabond2 n l.n w k, gmm(l.n) iv(l.(w k)) noleveleq small
    xtdpd l(0/1).n w k, dgmmiv(n) div(l.(w k)) nocons


    Until now, these two lines of code produced the same point estimates.
    But if I delete the years after 1978 to only have three years of data

    tab year
    drop if year>1978
    xtabond2 n l.n w k, gmm(l.n) iv(l.(w k)) noleveleq small
    xtdpd l(0/1).n w k, dgmmiv(n) div(l.(w k)) nocons


    There is output for xtabond2 but not for xtdpd, I wondered why? and how could I maybe make xtdpd produce the same results as xtabond2 when I only have 3 periods of data?

    Thank you so much,
    Alex

  • #2
    That seems to be a bug in xtdpd. If we do not drop the observations but run the command with an if qualifier instead, xtdpd delivers the desired output:
    Code:
    webuse abdata, clear
    xtabond2 n l.n w k if year <= 1978, gmm(l.n) iv(l.(w k)) noleveleq small
    xtdpd l(0/1).n w k if year <= 1978, dgmmiv(n) div(l.(w k)) nocons
    It is unclear why xtdpd fails to produce the same result if instead the later years are dropped. Those years do no play any role in the estimation. You might want to report this bug to Stata's technical support team.

    If you only have a data set with 3 observations to begin with, the following trick might help:
    Code:
    webuse abdata, clear
    drop if year > 1978
    insobs 1
    replace year = 1979 in `=_N'
    xtdpd l(0/1).n w k, dgmmiv(n) div(l.(w k)) nocons
    This adds an observation for year 1979 to the data set (but all variables other than the time identifier have missing values).

    Another alternative would be the xtdpdgmm command:
    Code:
    xtdpdgmm l(0/1).n w k, model(diff) gmmiv(l.n) iv(l.(w k), diff) nocons
    https://www.kripfganz.de/stata/

    Comment


    • #3
      Thank you so much, Sebastian!

      Comment

      Working...
      X