There are 3 issues here:
1) When replicating the xtdpdgmm results with ivreg2, you need to specify the untransformed variables.
2) You need to specify all untransformed regressors as endogenous, including time dummies.
3) ivreg2 applies collinearity checks that drop some of the instruments, even though it should not. You need to specify the nocollin option with ivreg2.
Code:
webuse abdata xtdpdgmm L(0/1).n, model(diff) gmm(L.n, l(2 5)) nocons vce(cluster id) teffects nolevel twostep quietly predict iv*, iv ivreg2 n (L1.n i.year = iv*), noconstant gmm2s cluster(id) nocollin
Leave a comment: