___ ____ ____ ____ ____tm /__ / ____/ / ____/ ___/ / /___/ / /___/ Statistics/Data Analysis ------------------------------------------------------------------------------- log: H:\Documents and Settings\Administrator\mroziv.smcl log type: smcl opened on: 6 Feb 2008, 11:57:48 1 . 2 . summarize Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- taxableinc | 753 21151.9 11891.38 1500 96000 federaltax | 753 3275.851 3477.541 0 31386 hsiblings | 753 3.450199 2.40743 0 8 hfathereduc | 753 8.524568 3.217265 0 17 hmothereduc | 753 9.2417 3.355293 0 17 -------------+-------------------------------------------------------- siblings | 753 3.253652 2.312821 0 8 lfp | 753 .5683931 .4956295 0 1 hours | 753 740.5764 871.3142 0 4950 kidsl6 | 753 .2377158 .523959 0 3 kids618 | 753 1.353254 1.319874 0 8 -------------+-------------------------------------------------------- age | 753 42.53785 8.072574 30 60 educ | 753 12.28685 2.280246 5 17 wage | 753 2.374565 3.241829 0 25 wage76 | 753 1.849734 2.419887 0 9.98 hhours | 753 2267.271 595.5666 175 5010 -------------+-------------------------------------------------------- hage | 753 45.12085 8.058793 30 60 heduc | 753 12.49137 3.020804 3 17 hwage | 753 7.482179 4.230559 .4121 40.509 faminc | 753 23080.59 12190.2 1500 96000 mtr | 753 .6788632 .0834955 .4415 .9415 -------------+-------------------------------------------------------- mothereduc | 753 9.250996 3.367468 0 17 fathereduc | 753 8.808765 3.57229 0 17 unemployment | 753 8.623506 3.114934 3 14 largecity | 753 .6427623 .4795042 0 1 exper | 753 10.63081 8.06913 0 45 3 . 4 . drop if lfp==0 (325 observations deleted) 5 . gen lwage = log(wage) 6 . gen exper2 = exper^2 7 . 8 . * Least squares estimation 9 . reg lwage educ exper exper2 Source | SS df MS Number of obs = 428 -------------+------------------------------ F( 3, 424) = 26.29 Model | 35.0222967 3 11.6740989 Prob > F = 0.0000 Residual | 188.305144 424 .444115906 R-squared = 0.1568 -------------+------------------------------ Adj R-squared = 0.1509 Total | 223.327441 427 .523015084 Root MSE = .66642 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- educ | .1074896 .0141465 7.60 0.000 .0796837 .1352956 exper | .0415665 .0131752 3.15 0.002 .0156697 .0674633 exper2 | -.0008112 .0003932 -2.06 0.040 -.0015841 -.0000382 _cons | -.5220406 .1986321 -2.63 0.009 -.9124667 -.1316144 ------------------------------------------------------------------------------ 10 . estimates store ls 11 . 12 . * IV estimation with surplus instruments 13 . ivregress 2sls lwage (educ=mothereduc fathereduc) exper exper2, small Instrumental variables (2SLS) regression Source | SS df MS Number of obs = 428 -------------+------------------------------ F( 3, 424) = 8.14 Model | 30.3074256 3 10.1024752 Prob > F = 0.0000 Residual | 193.020015 424 .455235885 R-squared = 0.1357 -------------+------------------------------ Adj R-squared = 0.1296 Total | 223.327441 427 .523015084 Root MSE = .67471 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- educ | .0613966 .0314367 1.95 0.051 -.0003945 .1231878 exper | .0441704 .0134325 3.29 0.001 .0177679 .0705729 exper2 | -.000899 .0004017 -2.24 0.026 -.0016885 -.0001094 _cons | .0481003 .4003281 0.12 0.904 -.7387744 .834975 ------------------------------------------------------------------------------ Instrumented: educ Instruments: exper exper2 mothereduc fathereduc 14 . estimates store iv 15 . 16 . * Hausman test regression based 17 . reg educ exper exper2 mothereduc fathereduc Source | SS df MS Number of obs = 428 -------------+------------------------------ F( 4, 423) = 28.36 Model | 471.620998 4 117.90525 Prob > F = 0.0000 Residual | 1758.57526 423 4.15738833 R-squared = 0.2115 -------------+------------------------------ Adj R-squared = 0.2040 Total | 2230.19626 427 5.22294206 Root MSE = 2.039 ------------------------------------------------------------------------------ educ | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- exper | .0452254 .0402507 1.12 0.262 -.0338909 .1243417 exper2 | -.0010091 .0012033 -0.84 0.402 -.0033744 .0013562 mothereduc | .157597 .0358941 4.39 0.000 .087044 .2281501 fathereduc | .1895484 .0337565 5.62 0.000 .1231971 .2558997 _cons | 9.10264 .4265614 21.34 0.000 8.264196 9.941084 ------------------------------------------------------------------------------ 18 . predict vhat, residuals 19 . reg lwage educ exper exper2 vhat, vce(robust) Linear regression Number of obs = 428 F( 4, 423) = 21.52 Prob > F = 0.0000 R-squared = 0.1624 Root MSE = .66502 ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- educ | .0613966 .0326667 1.88 0.061 -.0028127 .125606 exper | .0441704 .0151219 2.92 0.004 .0144469 .0738939 exper2 | -.000899 .0004152 -2.16 0.031 -.0017152 -.0000828 vhat | .0581666 .0364135 1.60 0.111 -.0134073 .1297405 _cons | .0481003 .4221019 0.11 0.909 -.7815781 .8777787 ------------------------------------------------------------------------------ 20 . 21 . * Hausman test automatic 22 . hausman iv ls, constant sigmamore Note: the rank of the differenced variance matrix (1) does not equal the number of coefficients being tested (4); be sure this is what you expect, or there may be problems computing the test. Examine the output of your estimators for anything unexpected and possibly consider scaling your variables so that the coefficients are on a similar scale. ---- Coefficients ---- | (b) (B) (b-B) sqrt(diag(V_b-V_B)) | iv ls Difference S.E. -------------+---------------------------------------------------------------- educ | .0613966 .1074896 -.046093 .0276406 exper | .0441704 .0415665 .0026039 .0015615 exper2 | -.000899 -.0008112 -.0000878 .0000526 _cons | .0481003 -.5220406 .5701409 .3418964 ------------------------------------------------------------------------------ b = consistent under Ho and Ha; obtained from ivregress B = inconsistent under Ha, efficient under Ho; obtained from regress Test: Ho: difference in coefficients not systematic chi2(1) = (b-B)'[(V_b-V_B)^(-1)](b-B) = 2.78 Prob>chi2 = 0.0954 (V_b-V_B is not positive definite) 23 . 24 . * Testing for weak instruments 25 . reg educ exper exper2 mothereduc Source | SS df MS Number of obs = 428 -------------+------------------------------ F( 3, 424) = 25.47 Model | 340.537834 3 113.512611 Prob > F = 0.0000 Residual | 1889.65843 424 4.45674158 R-squared = 0.1527 -------------+------------------------------ Adj R-squared = 0.1467 Total | 2230.19626 427 5.22294206 Root MSE = 2.1111 ------------------------------------------------------------------------------ educ | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- exper | .0488615 .0416693 1.17 0.242 -.0330425 .1307655 exper2 | -.0012811 .0012449 -1.03 0.304 -.003728 .0011659 mothereduc | .2676908 .0311298 8.60 0.000 .2065029 .3288787 _cons | 9.775103 .4238886 23.06 0.000 8.941918 10.60829 ------------------------------------------------------------------------------ 26 . reg educ exper exper2 fathereduc Source | SS df MS Number of obs = 428 -------------+------------------------------ F( 3, 424) = 30.09 Model | 391.477157 3 130.492386 Prob > F = 0.0000 Residual | 1838.7191 424 4.33660166 R-squared = 0.1755 -------------+------------------------------ Adj R-squared = 0.1697 Total | 2230.19626 427 5.22294206 Root MSE = 2.0825 ------------------------------------------------------------------------------ educ | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- exper | .0468243 .0411074 1.14 0.255 -.0339754 .127624 exper2 | -.0011504 .0012286 -0.94 0.350 -.0035652 .0012645 fathereduc | .2705061 .0288786 9.37 0.000 .2137431 .3272691 _cons | 9.887034 .3956078 24.99 0.000 9.109438 10.66463 ------------------------------------------------------------------------------ 27 . reg educ exper exper2 mothereduc fathereduc Source | SS df MS Number of obs = 428 -------------+------------------------------ F( 4, 423) = 28.36 Model | 471.620998 4 117.90525 Prob > F = 0.0000 Residual | 1758.57526 423 4.15738833 R-squared = 0.2115 -------------+------------------------------ Adj R-squared = 0.2040 Total | 2230.19626 427 5.22294206 Root MSE = 2.039 ------------------------------------------------------------------------------ educ | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- exper | .0452254 .0402507 1.12 0.262 -.0338909 .1243417 exper2 | -.0010091 .0012033 -0.84 0.402 -.0033744 .0013562 mothereduc | .157597 .0358941 4.39 0.000 .087044 .2281501 fathereduc | .1895484 .0337565 5.62 0.000 .1231971 .2558997 _cons | 9.10264 .4265614 21.34 0.000 8.264196 9.941084 ------------------------------------------------------------------------------ 28 . test mothereduc fathereduc ( 1) mothereduc = 0 ( 2) fathereduc = 0 F( 2, 423) = 55.40 Prob > F = 0.0000 29 . 30 . * Testing for weak instruments using estat 31 . ivregress 2sls lwage (educ=mothereduc fathereduc) exper exper2, small Instrumental variables (2SLS) regression Source | SS df MS Number of obs = 428 -------------+------------------------------ F( 3, 424) = 8.14 Model | 30.3074256 3 10.1024752 Prob > F = 0.0000 Residual | 193.020015 424 .455235885 R-squared = 0.1357 -------------+------------------------------ Adj R-squared = 0.1296 Total | 223.327441 427 .523015084 Root MSE = .67471 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- educ | .0613966 .0314367 1.95 0.051 -.0003945 .1231878 exper | .0441704 .0134325 3.29 0.001 .0177679 .0705729 exper2 | -.000899 .0004017 -2.24 0.026 -.0016885 -.0001094 _cons | .0481003 .4003281 0.12 0.904 -.7387744 .834975 ------------------------------------------------------------------------------ Instrumented: educ Instruments: exper exper2 mothereduc fathereduc 32 . estat firststage First-stage regression summary statistics -------------------------------------------------------------------------- | Adjusted Partial Variable | R-sq. R-sq. R-sq. F(2,423) Prob > F -------------+------------------------------------------------------------ educ | 0.2115 0.2040 0.2076 55.4003 0.0000 -------------------------------------------------------------------------- Minimum eigenvalue statistic = 55.4003 Critical Values # of endogenous regressors: 1 Ho: Instruments are weak # of excluded instruments: 2 --------------------------------------------------------------------- | 5% 10% 20% 30% 2SLS relative bias | (not available) -----------------------------------+--------------------------------- | 10% 15% 20% 25% 2SLS Size of nominal 5% Wald test | 19.93 11.59 8.75 7.25 LIML Size of nominal 5% Wald test | 8.68 5.33 4.42 3.92 --------------------------------------------------------------------- 33 . 34 . * Robust tests using ivregress 35 . ivregress 2sls lwage (educ=mothereduc fathereduc) exper exper2, small vce(rob > ust) Instrumental variables (2SLS) regression Number of obs = 428 F( 3, 424) = 6.15 Prob > F = 0.0004 R-squared = 0.1357 Adj R-squared = 0.1296 Root MSE = .67471 ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- educ | .0613966 .0333386 1.84 0.066 -.0041329 .1269261 exper | .0441704 .0155464 2.84 0.005 .0136128 .074728 exper2 | -.000899 .0004301 -2.09 0.037 -.0017443 -.0000536 _cons | .0481003 .4297977 0.11 0.911 -.7966992 .8928998 ------------------------------------------------------------------------------ Instrumented: educ Instruments: exper exper2 mothereduc fathereduc 36 . estat firststage First-stage regression summary statistics -------------------------------------------------------------------------- | Adjusted Partial Robust Variable | R-sq. R-sq. R-sq. F(2,423) Prob > F -------------+------------------------------------------------------------ educ | 0.2115 0.2040 0.2076 49.5266 0.0000 -------------------------------------------------------------------------- 37 . 38 . * Testing surplus moment conditions 39 . ivregress 2sls lwage (educ=mothereduc fathereduc) exper exper2, small Instrumental variables (2SLS) regression Source | SS df MS Number of obs = 428 -------------+------------------------------ F( 3, 424) = 8.14 Model | 30.3074256 3 10.1024752 Prob > F = 0.0000 Residual | 193.020015 424 .455235885 R-squared = 0.1357 -------------+------------------------------ Adj R-squared = 0.1296 Total | 223.327441 427 .523015084 Root MSE = .67471 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- educ | .0613966 .0314367 1.95 0.051 -.0003945 .1231878 exper | .0441704 .0134325 3.29 0.001 .0177679 .0705729 exper2 | -.000899 .0004017 -2.24 0.026 -.0016885 -.0001094 _cons | .0481003 .4003281 0.12 0.904 -.7387744 .834975 ------------------------------------------------------------------------------ Instrumented: educ Instruments: exper exper2 mothereduc fathereduc 40 . predict ehat, residuals 41 . quietly reg ehat mothereduc fathereduc exper exper2 42 . scalar nr2 = e(N)*e(r2) 43 . scalar chic = invchi2tail(1,.05) 44 . scalar pvalue = chi2tail(1,nr2) 45 . di "NR^2 test of overidentifying restriction = " nr2 NR^2 test of overidentifying restriction = .37807138 46 . di "Chi-square critical value 1 df, .05 level = " chic Chi-square critical value 1 df, .05 level = 3.8414588 47 . di "p value for overidentifying test 1 df, .05 level = " pvalue p value for overidentifying test 1 df, .05 level = .53863721 48 . 49 . * Using estat 50 . quietly ivregress 2sls lwage (educ=mothereduc fathereduc) exper exper2, small 51 . estat overid Tests of overidentifying restrictions: Sargan (score) chi2(1) = .378071 (p = 0.5386) Basmann chi2(1) = .373985 (p = 0.5408) 52 . 53 . * Durbin Wu Hausman 54 . regress educ mothereduc fathereduc exper exper2 Source | SS df MS Number of obs = 428 -------------+------------------------------ F( 4, 423) = 28.36 Model | 471.620998 4 117.90525 Prob > F = 0.0000 Residual | 1758.57526 423 4.15738833 R-squared = 0.2115 -------------+------------------------------ Adj R-squared = 0.2040 Total | 2230.19626 427 5.22294206 Root MSE = 2.039 ------------------------------------------------------------------------------ educ | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- mothereduc | .157597 .0358941 4.39 0.000 .087044 .2281501 fathereduc | .1895484 .0337565 5.62 0.000 .1231971 .2558997 exper | .0452254 .0402507 1.12 0.262 -.0338909 .1243417 exper2 | -.0010091 .0012033 -0.84 0.402 -.0033744 .0013562 _cons | 9.10264 .4265614 21.34 0.000 8.264196 9.941084 ------------------------------------------------------------------------------ 55 . predict yhat, xb 56 . regress lwage educ exper exper2 yhat, vce(robust) Linear regression Number of obs = 428 F( 4, 423) = 21.52 Prob > F = 0.0000 R-squared = 0.1624 Root MSE = .66502 ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- educ | .1195632 .0148342 8.06 0.000 .0904053 .1487212 exper | .0441704 .0151219 2.92 0.004 .0144469 .0738939 exper2 | -.000899 .0004152 -2.16 0.031 -.0017152 -.0000828 yhat | -.0581666 .0364135 -1.60 0.111 -.1297405 .0134073 _cons | .0481003 .4221019 0.11 0.909 -.7815781 .8777787 ------------------------------------------------------------------------------ 57 . test yhat ( 1) yhat = 0 F( 1, 423) = 2.55 Prob > F = 0.1109 58 . 59 . log close log: H:\Documents and Settings\Administrator\mroziv.smcl log type: smcl closed on: 6 Feb 2008, 11:57:49 -------------------------------------------------------------------------------