Originally posted by haiyan lin
View Post
-
Login or Register
- Log in with
xtdpdgmm pntbt L.pntbt ob_agre subnormal inadpf log_decapu log_pib log_iasc log_tarid, /// gmmiv(L.pntbt, lag(2 2) m(d) collapse) /// gmmiv(L.pntbt, lag(1 1) m(l) diff collapse) /// gmmiv(log_decapu, lag(2 2) m(d) collapse) /// gmmiv(log_decapu, lag(1 1) m(l) diff collapse) /// gmmiv(log_tarid, lag(2 2) m(d) collapse) /// gmmiv(log_tarid, lag(1 1) m(l) diff collapse) /// gmmiv(ob_agre subnormal inadpf log_pib log_iasc, lag(1 1) m(d) collapse) /// gmmiv(ob_agre subnormal inadpf log_pib log_iasc, lag(1 1) m(l) diff collapse) /// twostep vce(r) overid
net install xtdpdgmm, from(http://www.kripfganz.de/stata/) replace
xtdpdgmm yield_mtha L.yield_mtha rs_gdd_s2 rs_hdd_s2 rs_precip_s2, /// model(diff) gmm(yield_mtha, lag(2 .)) gmm(rs_gdd_s2 rs_hdd_s2 rs_precip_s2, lag(. .)) note: standard errors may not be valid Generalized method of moments estimation Fitting full model: Step 1 f(b) = 3.3141562 Group variable: code_muni Number of obs = 13272 Time variable: year Number of groups = 474 Moment conditions: linear = 2728 Obs per group: min = 28 nonlinear = 0 avg = 28 total = 2728 max = 28 ------------------------------------------------------------------------------ yield_mtha | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- yield_mtha | L1. | .4519066 .0089698 50.38 0.000 .4343261 .469487 | rs_gdd_s2 | .1722979 .0518055 3.33 0.001 .070761 .2738348 rs_hdd_s2 | -1.925162 .496409 -3.88 0.000 -2.898106 -.9522184 rs_precip_s2 | .158965 .0150132 10.59 0.000 .1295397 .1883903 _cons | .1510277 .1209611 1.25 0.212 -.0860518 .3881071 ------------------------------------------------------------------------------ Instruments corresponding to the linear moment conditions: 1, model(diff): 1992:L2.yield_mtha 1993:L2.yield_mtha 1994:L2.yield_mtha 1995:L2.yield_mtha 1996:L2.yield_mtha 1997:L2.yield_mtha 1998:L2.yield_mtha 1999:L2.yield_mtha 2000:L2.yield_mtha 2001:L2.yield_mtha 2002:L2.yield_mtha 2003:L2.yield_mtha 2004:L2.yield_mtha 2005:L2.yield_mtha 2006:L2.yield_mtha 2007:L2.yield_mtha 2008:L2.yield_mtha 2009:L2.yield_mtha 2010:L2.yield_mtha 2011:L2.yield_mtha ....... ....... .......
estat serial, ar(1/3) Arellano-Bond test for autocorrelation of the first-differenced residuals H0: no autocorrelation of order 1: z = -50.3692 Prob > |z| = 0.0000 H0: no autocorrelation of order 2: z = 23.5852 Prob > |z| = 0.0000 H0: no autocorrelation of order 3: z = -13.4781 Prob > |z| = 0.0000
xtdpdgmm yield_mtha L.yield_mtha L2.yield_mtha rs_gdd_s2 rs_hdd_s2 rs_precip_s2, /// > model(diff) gmm(yield_mtha yield_dev, lag(3 .)) iv(rs_gdd_s2 rs_hdd_s2 rs_precip_s2, model(mdev)) two coll vce(r) Generalized method of moments estimation Fitting full model: Step 1 f(b) = .61599272 Step 2 f(b) = .7763858 Group variable: code_muni Number of obs = 12798 Time variable: year Number of groups = 474 Moment conditions: linear = 56 Obs per group: min = 27 nonlinear = 0 avg = 27 total = 56 max = 27 (Std. Err. adjusted for 474 clusters in code_muni) ------------------------------------------------------------------------------ | WC-Robust yield_mtha | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- yield_mtha | L1. | .3454116 .047806 7.23 0.000 .2517135 .4391097 L2. | .2802068 .0349527 8.02 0.000 .2117008 .3487128 | rs_gdd_s2 | .0898764 .0793811 1.13 0.258 -.0657077 .2454606 rs_hdd_s2 | -2.144849 1.132075 -1.89 0.058 -4.363676 .073978 rs_precip_s2 | .1919315 .0210945 9.10 0.000 .1505871 .233276 _cons | .0627011 .178586 0.35 0.726 -.2873209 .4127232 ------------------------------------------------------------------------------ Instruments corresponding to the linear moment conditions: 1, model(diff): L3.yield_mtha L4.yield_mtha L5.yield_mtha L6.yield_mtha L7.yield_mtha L8.yield_mtha L9.yield_mtha L10.yield_mtha L11.yield_mtha L12.yield_mtha L13.yield_mtha L14.yield_mtha L15.yield_mtha L16.yield_mtha L17.yield_mtha L18.yield_mtha L19.yield_mtha L20.yield_mtha L21.yield_mtha L22.yield_mtha L23.yield_mtha L24.yield_mtha L25.yield_mtha L26.yield_mtha L27.yield_mtha L28.yield_mtha L3.yield_dev L4.yield_dev L5.yield_dev L6.yield_dev L7.yield_dev L8.yield_dev L9.yield_dev L10.yield_dev L11.yield_dev L12.yield_dev L13.yield_dev L14.yield_dev L15.yield_dev L16.yield_dev L17.yield_dev L18.yield_dev L19.yield_dev L20.yield_dev L21.yield_dev L22.yield_dev L23.yield_dev L24.yield_dev L25.yield_dev L26.yield_dev L27.yield_dev L28.yield_dev 2, model(mdev): rs_gdd_s2 rs_hdd_s2 rs_precip_s2 3, model(level): _cons . . estat serial, ar(1/3) Arellano-Bond test for autocorrelation of the first-differenced residuals H0: no autocorrelation of order 1: z = -8.8835 Prob > |z| = 0.0000 H0: no autocorrelation of order 2: z = 1.4192 Prob > |z| = 0.1559 H0: no autocorrelation of order 3: z = -3.3863 Prob > |z| = 0.0007 . estat overid Sargan-Hansen test of the overidentifying restrictions H0: overidentifying restrictions are valid 2-step moment functions, 2-step weighting matrix chi2(50) = 368.0069 Prob > chi2 = 0.0000 2-step moment functions, 3-step weighting matrix chi2(50) = 375.7389 Prob > chi2 = 0.0000
. areg yield_mtha L.yield_mtha L2.yield_mtha rs_gdd_s2 rs_hdd_s2 rs_precip_s2, absorb (code_muni) vce(cluster code_muni) Linear regression, absorbing indicators Number of obs = 12,798 F( 5, 473) = 353.32 Prob > F = 0.0000 R-squared = 0.4831 Adj R-squared = 0.4631 Root MSE = 0.4588 (Std. Err. adjusted for 474 clusters in code_muni) ------------------------------------------------------------------------------ | Robust yield_mtha | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- yield_mtha | L1. | .3292273 .0200585 16.41 0.000 .2898126 .3686421 L2. | .2575985 .0157955 16.31 0.000 .2265606 .2886365 | rs_gdd_s2 | .0939887 .0570919 1.65 0.100 -.0181964 .2061737 rs_hdd_s2 | -2.253687 .7521274 -3.00 0.003 -3.731612 -.7757632 rs_precip_s2 | .1822983 .0145616 12.52 0.000 .1536849 .2109116 _cons | .128067 .1301362 0.98 0.326 -.1276496 .3837836 -------------+---------------------------------------------------------------- code_muni | absorbed (474 categories)
net install xtdpdgmm, from(http://www.kripfganz.de/stata) replace
xtdpdgmm L(0/1).ln_output $var, coll model(diff) gmm(ln_output, lag(2 .)) gmm(ln_export, lag(2 .)) gmm(lgm2int, lag(2 .)) gmm(c.ln_export#c.lgm2int, lag(2 .)) gmm(ln_v1115, lag(2 .)) teffect two overid vce(robust) small
underid, overid underid kp sw noreport
collinearity check... collinearities detected in [Y X Z] (right to left): __alliv_18 __alliv_17 __alliv_16 collinearities detected in [X Z Y] (right to left): 2012.year 2011.year 2010bn.year warning: collinearities detected, reparameterization may be advisable Overidentification test: Kleibergen-Paap robust LIML-based (LM version) Test statistic robust to heteroskedasticity and clustering on psid j= 3.74 Chi-sq( 10) p-value=0.9584 Underidentification test: Kleibergen-Paap robust LIML-based (LM version) Test statistic robust to heteroskedasticity and clustering on psid j= 9.92 Chi-sq( 11) p-value=0.5378 2-step GMM J underidentification stats by regressor: j= 12.40 Chi-sq( 11) p-value=0.3345 L.ln_output j= 16.89 Chi-sq( 11) p-value=0.1112 ln_export j= 11.07 Chi-sq( 11) p-value=0.4371 lgm2int j= 11.38 Chi-sq( 11) p-value=0.4123 c.ln_export#c.lgm2int j= 22.75 Chi-sq( 11) p-value=0.0191 ln_v1115 j= 24.55 Chi-sq( 11) p-value=0.0106 2010bn.year j= 24.55 Chi-sq( 11) p-value=0.0106 2011.year j= 24.55 Chi-sq( 11) p-value=0.0106 2012.year
xtdpdgmm L(0/1).ln_output $var, coll model(diff) gmm(ln_output, lag(2 .)) gmm(ln_output, lag(1 1) model(level)) gmm(ln_v1115, lag(1 1) model(level)) teffect two overid vce(robust) small gmm(ln_export, lag(1 1) model(level)) gmm(lgm2int, lag(1 1) model(level)) gmm(c.ln_export#c.lgm2int, lag(1 1) model(level))
estat overid, difference Sargan-Hansen (difference) test of the overidentifying restrictions H0: (additional) overidentifying restrictions are valid 2-step weighting matrix from full model | Excluding | Difference Moment conditions | chi2 df p | chi2 df p ------------------+-----------------------------+----------------------------- 1, model(diff) | 0.0000 0 . | 1.8547 3 0.6031 2, model(level) | 1.5235 2 0.4669 | 0.3312 1 0.5649 3, model(level) | 1.6436 2 0.4396 | 0.2111 1 0.6459 4, model(level) | 1.6813 2 0.4314 | 0.1734 1 0.6771 5, model(level) | 1.6548 2 0.4372 | 0.2000 1 0.6548 6, model(level) | 1.7867 2 0.4093 | 0.0680 1 0.7943 7, model(level) | 0.0000 0 . | 1.8547 3 0.6031 model(level) | . -5 . | . . .
. estat serial, ar(1/2) Arellano-Bond test for autocorrelation of the first-differenced residuals H0: no autocorrelation of order 1: z = . Prob > |z| = . H0: no autocorrelation of order 2: z = 1.4313 Prob > |z| = 0.1523
. underid, underid kp sw noreport collinearity check... collinearities detected in [Y X Z] (right to left): __alliv_11 __alliv_10 __alliv_9 __alliv_4 collinearities detected in [X Z Y] (right to left): 2012.year 2011.year 2010bn.year L.ln_output warning: collinearities detected, reparameterization may be advisable Underidentification test: Kleibergen-Paap robust LIML-based (LM version) Test statistic robust to heteroskedasticity and clustering on psid j= 95.61 Chi-sq( 4) p-value=0.0000 2-step GMM J underidentification stats by regressor: j= 111.89 Chi-sq( 4) p-value=0.0000 L.ln_output j= 90.59 Chi-sq( 4) p-value=0.0000 ln_export j= 74.49 Chi-sq( 4) p-value=0.0000 lgm2int j= 72.65 Chi-sq( 4) p-value=0.0000 c.ln_export#c.lgm2int j= 97.95 Chi-sq( 4) p-value=0.0000 ln_v1115 j= 942.49 Chi-sq( 4) p-value=0.0000 2010bn.year j= 942.49 Chi-sq( 4) p-value=0.0000 2011.year j= 942.49 Chi-sq( 4) p-value=0.0000 2012.year
Comment