Hi,
I am trying to verify the results from xtdpdgmm with xtabond2. I am using Stata18.5 for Mac.
That is I am running a two-step difference GMM regression using the xtdpdgmm function with teffects. For verification, I want to replicate the results from xtdpdgmm without teffects with the xtabond2 function (I exclude teffects as there are issues when including time dummies in xtabond2). However I don't get the same results, can someone help me understand why?
The two step difference GMM code and results using xtdpdgmm:
and the "corresponding" two step difference GMM code and results using xtabond2:
I am trying to verify the results from xtdpdgmm with xtabond2. I am using Stata18.5 for Mac.
That is I am running a two-step difference GMM regression using the xtdpdgmm function with teffects. For verification, I want to replicate the results from xtdpdgmm without teffects with the xtabond2 function (I exclude teffects as there are issues when including time dummies in xtabond2). However I don't get the same results, can someone help me understand why?
The two step difference GMM code and results using xtdpdgmm:
Code:
xtdpdgmm ln_migration_flow_rate_abel l.ln_trade_flow l.ln_fdi_flow l.ln_aid_flow ln_incdiff ln_distw_arithmetic agree_fta l.ln_migration_stock, model(diff) ///
> gmm(ln_trade_flow ln_fdi_flow ln_aid_flow, collapse l(2 3)) gmm(ln_migration_stock, collapse l(2 4)) ///
> iv(ln_distw_arithmetic ln_incdiff ln_distw_arithmetic agree_fta) ///
> twostep vce(cl group_id_num)
Generalized method of moments estimation
Fitting full model:
Step 1 f(b) = 6.329e-06
Step 2 f(b) = .00125101
Group variable: group_id_num Number of obs = 65792
Time variable: year Number of groups = 16768
Moment conditions: linear = 13 Obs per group: min = 1
nonlinear = 0 avg = 3.923664
total = 13 max = 4
(Std. err. adjusted for 16,768 clusters in group_id_num)
-------------------------------------------------------------------------------------
| WC-Robust
ln_migration~e_abel | Coefficient std. err. z P>|z| [95% conf. interval]
--------------------+----------------------------------------------------------------
ln_trade_flow |
L1. | .0007083 .0001893 3.74 0.000 .0003372 .0010794
|
ln_fdi_flow |
L1. | -.0000811 .0003975 -0.20 0.838 -.0008602 .0006979
|
ln_aid_flow |
L1. | -.0025226 .0011141 -2.26 0.024 -.0047061 -.000339
|
ln_incdiff | .0271516 .0050611 5.36 0.000 .0172321 .0370711
ln_distw_arithmetic | -.0045189 .0010012 -4.51 0.000 -.0064812 -.0025566
agree_fta | -.0016337 .0019587 -0.83 0.404 -.0054728 .0022053
|
ln_migration_stock |
L1. | .0343245 .0068038 5.04 0.000 .0209893 .0476598
|
_cons | 0 (omitted)
-------------------------------------------------------------------------------------
Instruments corresponding to the linear moment conditions:
1, model(diff):
L2.ln_trade_flow L3.ln_trade_flow L2.ln_fdi_flow L3.ln_fdi_flow
L2.ln_aid_flow L3.ln_aid_flow
2, model(diff):
L2.ln_migration_stock L3.ln_migration_stock L4.ln_migration_stock
3, model(diff):
ln_distw_arithmetic ln_incdiff agree_fta
4, model(level):
_cons
and the "corresponding" two step difference GMM code and results using xtabond2:
Code:
. xtabond2 ln_migration_flow_rate_abel l.ln_trade_flow l.ln_fdi_flow l.ln_aid_flow ln_incdiff ln_distw_arithmetic agree_fta l.ln_migration_stock, ///
> gmm(ln_trade_flow ln_fdi_flow ln_aid_flow, collapse l(2 3)) gmm(ln_migration_stock, collapse l(2 4)) ///
> iv(ln_distw_arithmetic ln_incdiff ln_distw_arithmetic agree_fta) ///
> twostep noleveleq robust
Favoring space over speed. To switch, type or click on mata: mata set matafavor speed, perm.
Warning: Two-step estimated covariance matrix of moments is singular.
Using a generalized inverse to calculate optimal weighting matrix for two-step estimation.
Difference-in-Sargan/Hansen statistics may be negative.
Dynamic panel-data estimation, two-step difference GMM
------------------------------------------------------------------------------
Group variable: group_id_num Number of obs = 49024
Time variable : year Number of groups = 16512
Number of instruments = 12 Obs per group: min = 0
Wald chi2(0) = . avg = 2.97
Prob > chi2 = . max = 3
-------------------------------------------------------------------------------------
| Corrected
ln_migration~e_abel | Coefficient std. err. z P>|z| [95% conf. interval]
--------------------+----------------------------------------------------------------
ln_trade_flow |
L1. | -.0000199 .0008873 -0.02 0.982 -.001759 .0017191
|
ln_fdi_flow |
L1. | -.0041041 .0009092 -4.51 0.000 -.0058861 -.0023221
|
ln_aid_flow |
L1. | .0167241 .0047601 3.51 0.000 .0073946 .0260537
|
ln_incdiff | -.0026251 .0015441 -1.70 0.089 -.0056515 .0004012
ln_distw_arithmetic | .8052125 1.218838 0.66 0.509 -1.583665 3.19409
agree_fta | .0034223 .0017649 1.94 0.052 -.000037 .0068815
|
ln_migration_stock |
L1. | .0053686 .0065721 0.82 0.414 -.0075124 .0182496
-------------------------------------------------------------------------------------
Instruments for first differences equation
Standard
D.(ln_distw_arithmetic ln_incdiff ln_distw_arithmetic agree_fta)
GMM-type (missing=0, separate instruments for each period unless collapsed)
L(2/4).ln_migration_stock collapsed
L(2/3).(ln_trade_flow ln_fdi_flow ln_aid_flow) collapsed
------------------------------------------------------------------------------
Arellano-Bond test for AR(1) in first differences: z = -3.53 Pr > z = 0.000
Arellano-Bond test for AR(2) in first differences: z = -2.18 Pr > z = 0.029
------------------------------------------------------------------------------
Sargan test of overid. restrictions: chi2(5) = 43.22 Prob > chi2 = 0.000
(Not robust, but not weakened by many instruments.)
Hansen test of overid. restrictions: chi2(5) = 10.20 Prob > chi2 = 0.070
(Robust, but weakened by many instruments.)
Difference-in-Hansen tests of exogeneity of instrument subsets:
gmm(ln_migration_stock, collapse lag(2 4))
Hansen test excluding group: chi2(2) = 5.10 Prob > chi2 = 0.078
Difference (null H = exogenous): chi2(3) = 5.11 Prob > chi2 = 0.164
iv(ln_distw_arithmetic ln_incdiff ln_distw_arithmetic agree_fta)
Hansen test excluding group: chi2(2) = 3.68 Prob > chi2 = 0.159
Difference (null H = exogenous): chi2(3) = 6.52 Prob > chi2 = 0.089

Comment