??? GMM for OLS and 2SLS ??? 2SLS_MROZ.LIM ? Note that OLS and 2SLS are special cases of GMM. ? In those (easy and) special cases, we do not need to use GMM. But, ? we wish to demonstrate to use the GMM to obtain the same (similar) results. ? MROZ.dat, Wooldridge, p. 544 Read ; Nobs = 753 ; Nvar = 22 ; file = mroz.dat ; Names = 3 $ Namelist ; x1 = exper, expersq $ Namelist ; z1 = motheduc, fatheduc, huseduc $ Namelist ; z = x1, z1 $ Namelist ; x = One, educ, x1 $ Sample ; 1-428 $ ? OLS Regress ; Lhs = lwage ; Rhs = One, educ, x1 $ /* +-----------------------------------------------------------------------+ | Ordinary least squares regression Weighting variable = none | | Dep. var. = LWAGE Mean= 1.190173319 , S.D.= .7231978387 | | Model size: Observations = 428, Parameters = 4, Deg.Fr.= 424 | | Residuals: Sum of squares= 188.3051511 , Std.Dev.= .66642 | | Fit: R-squared= .156820, Adjusted R-squared = .15085 | | Model test: F[ 3, 424] = 26.29, Prob value = .00000 | | Diagnostic: Log-L = -431.5990, Restricted(b=0) Log-L = -468.1021 | | LogAmemiyaPrCrt.= -.802, Akaike Info. Crt.= 2.036 | | Autocorrel: Durbin-Watson Statistic = 1.96099, Rho = .01951 | +-----------------------------------------------------------------------+ +---------+--------------+----------------+--------+---------+----------+ |Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X| +---------+--------------+----------------+--------+---------+----------+ Constant -.5220406803 .19863207 -2.628 .0089 EDUC .1074896496 .14146479E-01 7.598 .0000 12.658879 EXPER .4156650950E-01 .13175198E-01 3.155 .0017 13.037383 EXPERSQ -.8111930413E-03 .39324214E-03 -2.063 .0397 234.71963 (Note: E+nn or E-nn means multiply by 10 to + or -nn power.) */ GMME ; Labels = b1, b2, b3, b4 ; start = 0, 0, 0, 0 ; Fn1 = lwage - b1 - b2*educ - b3*exper - b4*expersq ; Fn2 = educ*(lwage - b1 - b2*educ - b3*exper - b4*expersq) ; Fn3 = exper*(lwage - b1 - b2*educ - b3*exper - b4*expersq) ; Fn4 = expersq*(lwage - b1 - b2*educ - b3*exper - b4*expersq) $ /* Note: DFP and BFGS usually take more than 4 or 5 iterations to converge. If this problem was not structured for quick convergence, you might want to examine results closely. If convergence is too early, tighten convergence with, e.g., ;TLG=1.D-9. Normal exit from iterations. Exit status=0. +---------------------------------------------+ | User Defined Optimization | | Prob[ChiSqd > value] = 1.000000 | | Model estimated: Oct 21, 2002 at 11:37:37PM.| | Dependent variable Function | | Weighting variable None | | Number of observations 428 | | GMM Criterion function .00000 | | Degrees of freedom = #eqn-#parms = 0 | | Significance level 1.00000 | | Covariance matrix for moments kept as SIGMA | +---------------------------------------------+ +---------+--------------+----------------+--------+---------+ |Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | +---------+--------------+----------------+--------+---------+ B1 -.5220406732 .19484319 -2.679 .0074 B2 .1074896494 .13047255E-01 8.238 .0000 B3 .4156650861E-01 .15219187E-01 2.731 .0063 B4 -.8111930139E-03 .41760047E-03 -1.943 .0521 (Note: E+nn or E-nn means multiply by 10 to + or -nn power.) */ ? 2SLS 2SLS ; Lhs = lwage ; Rhs = One, educ, x1 ; Inst = One, z $ /* +-----------------------------------------------------------------------+ | Two stage least squares regression Weighting variable = none | | Dep. var. = LWAGE Mean= 1.190173319 , S.D.= .7231978387 | | Model size: Observations = 428, Parameters = 4, Deg.Fr.= 424 | | Residuals: Sum of squares= 188.1596202 , Std.Dev.= .66616 | | Fit: R-squared= .149524, Adjusted R-squared = .14351 | | (Note: Not using OLS. R-squared is not bounded in [0,1] | | Model test: F[ 3, 424] = 24.85, Prob value = .00000 | | Diagnostic: Log-L = -431.4335, Restricted(b=0) Log-L = -468.1021 | | LogAmemiyaPrCrt.= -.803, Akaike Info. Crt.= 2.035 | | Autocorrel: Durbin-Watson Statistic = 1.95205, Rho = .02398 | +-----------------------------------------------------------------------+ +---------+--------------+----------------+--------+---------+----------+ |Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X| +---------+--------------+----------------+--------+---------+----------+ Constant -.1868573479 .28405914 -.658 .5107 EDUC .8039176898E-01 .21671985E-01 3.709 .0002 12.658879 EXPER .4309732149E-01 .13202743E-01 3.264 .0011 13.037383 EXPERSQ -.8627964654E-03 .39433230E-03 -2.188 .0287 234.71963 (Note: E+nn or E-nn means multiply by 10 to + or -nn power.) */ ? 1st step GMME ; Labels = b1, b2, b3, b4 ; start = 0, 0, 0, 0 ; Fn1 = lwage - b1 - b2*educ - b3*exper - b4*expersq ; Fn2 = exper*(lwage - b1 - b2*educ - b3*exper - b4*expersq) ; Fn3 = expersq*(lwage - b1 - b2*educ - b3*exper - b4*expersq) ; Fn4 = motheduc*(lwage - b1 - b2*educ - b3*exper - b4*expersq) ; Fn5 = fatheduc*(lwage - b1 - b2*educ - b3*exper - b4*expersq) ; Fn6 = huseduc*(lwage - b1 - b2*educ - b3*exper - b4*expersq) $ Matrix ; optimalw = $ /* Note: DFP and BFGS usually take more than 4 or 5 iterations to converge. If this problem was not structured for quick convergence, you might want to examine results closely. If convergence is too early, tighten convergence with, e.g., ;TLG=1.D-9. Normal exit from iterations. Exit status=0. +---------------------------------------------+ | User Defined Optimization | | Prob[ChiSqd > value] = .9999641 | | Model estimated: Oct 21, 2002 at 11:35:04PM.| | Dependent variable Function | | Weighting variable None | | Number of observations 428 | | GMM Criterion function .00850 | | Degrees of freedom = #eqn-#parms = 2 | | Significance level .99576 | | Covariance matrix for moments kept as SIGMA | +---------------------------------------------+ +---------+--------------+----------------+--------+---------+ |Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | +---------+--------------+----------------+--------+---------+ B1 -.8492042015 1.5478513 -.549 .5833 B2 .1230638150 .10400276 1.183 .2367 B3 .5743097237E-01 .30124173E-01 1.906 .0566 B4 -.1206116926E-02 .73097006E-03 -1.650 .0989 (Note: E+nn or E-nn means multiply by 10 to + or -nn power.) */ ? 2nd step GMME ; Labels = b1, b2, b3, b4 ; start = 0, 0, 0, 0 ; Fn1 = lwage - b1 - b2*educ - b3*exper - b4*expersq ; Fn2 = exper*(lwage - b1 - b2*educ - b3*exper - b4*expersq) ; Fn3 = expersq*(lwage - b1 - b2*educ - b3*exper - b4*expersq) ; Fn4 = motheduc*(lwage - b1 - b2*educ - b3*exper - b4*expersq) ; Fn5 = fatheduc*(lwage - b1 - b2*educ - b3*exper - b4*expersq) ; Fn6 = huseduc*(lwage - b1 - b2*educ - b3*exper - b4*expersq) ; Sigma = optimalw $ /* Note: DFP and BFGS usually take more than 4 or 5 iterations to converge. If this problem was not structured for quick convergence, you might want to examine results closely. If convergence is too early, tighten convergence with, e.g., ;TLG=1.D-9. Normal exit from iterations. Exit status=0. +---------------------------------------------+ | User Defined Optimization | | Prob[ChiSqd > value] = .7215860 | | Model estimated: Oct 21, 2002 at 11:46:29PM.| | Dependent variable Function | | Weighting variable None | | Number of observations 428 | | GMM Criterion function 1.03854 | | Degrees of freedom = #eqn-#parms = 2 | | Significance level .59496 | | Covariance matrix for moments kept as SIGMA | +---------------------------------------------+ +---------+--------------+----------------+--------+---------+ |Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | +---------+--------------+----------------+--------+---------+ B1 -.1928627255 .29766102 -.648 .5170 B2 .8077123704E-01 .21266585E-01 3.798 .0001 B3 .4407734358E-01 .15143769E-01 2.911 .0036 B4 -.8983736526E-03 .41662994E-03 -2.156 .0311 (Note: E+nn or E-nn means multiply by 10 to + or -nn power.) */