Announcement

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

  • Question about xtdpdsys: Using Sargan test with T=3 waves

    Hello,

    Long time reader, first-time poster.

    My co-author and I are using xtdpdsys with balanced panel data (N=1000, T=3).

    We are pretty sure the Sargan test requires more than 3 time periods. Indeed, we are unable to get it working. It looks like when T=3, even the simplest model has a degrees of freedom no greater than 0. But we want to be sure.

    Here is an example of 15 rows from a simulated dataset.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input long(i t) double(x1 y)
    1 1  2.2084385486757485 11.646731131691757
    2 1  .23378660636330695 14.663789786932547
    3 1   .6825519887300893 -6.981449371422894
    4 1  2.0390332458131897  -8.82068328641484
    5 1   -2.72878009591048 -9.599597269354156
    1 2  -1.853182982207116 11.016819605611865
    2 2 -1.5362324441660111  13.17247704556975
    3 2  -.8271593272208249 -5.282668540758706
    4 2   2.066455340267561 -7.099031966361922
    5 2   -.816470191872443 -8.997773104346265
    1 3   .7030733792317743 10.799990529332979
    2 3 -3.0652765273362306 10.707641858912446
    3 3 -.21908305552125043 -5.290678567244152
    4 3 -1.1673662381441967 -7.649146308767151
    5 3 -1.5430755000892493   -8.7565115760634
    end

    When I run:

    . tsset i t
    . xtdpdsys y l.x1 t, maxldep(10) twostep
    . estat sargan

    the result is a positive Chi2 value but a missing p-value (".").

    Similarly, `. matrix list r(table)` returns a missing df (".") for
    each variable.

    It is possible to implement the Sargan test after xtdpdsys given only three panel waves?

    Thank you!

    Cheers,
    Vince

  • #2
    When I run you code, xtdpdsys claims that there are only 2 instruments. There is obviously a bug in the xtdpdsys program.

    The following code is supposed to replicate the xtdpdsys results (if there was no bug) and to show the result of the Hansen overidentification test:
    Code:
    xtdpdgmm y L.y L.x1 t, gmm(y, lag(2 .) m(diff)) iv(LD.x1 D.t, m(diff)) gmm(D.y, lag(1 1) m(level)) wmat(ind) twostep
    estat overid
    There are 5 instruments available for 4 regression coefficients. Thus, there is 1 overidentifying restriction such that it is possible to compute the overidentification test.

    Note: xtdpdgmm is a community-contributed command:
    XTDPDGMM: new Stata command for efficient GMM estimation of linear (dynamic) panel models with nonlinear moment conditions
    https://www.kripfganz.de/stata/

    Comment

    Working...
    X