İnsan TUNALI 8 November 2018 Econ 511: Econometrics I ASSIGNMENT 7 STATA Supplement. use "F:\COURSES\GRADS\ECON511\SHARE\wages1.dta", clear. generate =ln(wage). scatter sch Q. Do you see a relationship between log-wages and years of ing? A. NO.
. tab male, sum(wage) Summary of wage male Mean Std. Dev. Freq. ------------+------------------------------------ 0 5.1469239 2.8762371 1569 1 6.3130212 3.4988613 1725 ------------+------------------------------------ Total 5.757585 3.2691858 3294 * On average males earn more than females; raw wage gap is 6.31 5.15 = 1.16 $/hr.. tab male,sum(sch) Summary of male Mean Std. Dev. Freq. ------------+------------------------------------ 0 11.837476 1.5393554 1569 1 11.442319 1.7373191 1725 ------------+------------------------------------ Total 11.63054 1.6575447 3294 * On average females have a little bit more ing than females. * Interact with male dummy:. generate sch_m=*male * RETURNS TO SCHOOLING:. regress -------------+------------------------------ F( 1, 3292) = 279.99 Model 100.095029 1 100.095029 Prob > F = 0.0000 Residual 1176.88386 3292.357498135 R-squared = 0.0784 -------------+------------------------------ Adj R-squared = 0.0781 Total 1276.97889 3293.387785876 Root MSE =.59791 Coef. Std. Err. t P> t [95% Conf. Interval].1051829.006286 16.73 0.000.092858.1175078 _cons.3639343.0738483 4.93 0.000.219141.5087276 * An additonal year of ing increases wages by 11%.
. predict yhat (option xb assumed; fitted values). scatter yhat.5 1 1.5 2 Fitted values * Earlier you looked at:. scatter sch Q. Are there any surprises here? A. NO: yhat is an exact linear combination of sch. Also see Fall 2014 Midterm Exam Part IV (2).
. scatter yhat, connect(l) ytitle("yhat") yhat.5 1 1.5 2. scatter yhat, connect(. l) ytitle("yhat") yhat Fitted values
* ADDITIVE SHIFT (AS) MODEL:. regress male -------------+------------------------------ F( 2, 3291) = 227.15 Model 154.898049 2 77.4490243 Prob > F = 0.0000 Residual 1122.08084 3291.340954373 R-squared = 0.1213 -------------+------------------------------ Adj R-squared = 0.1208 Total 1276.97889 3293.387785876 Root MSE =.58391 Coef. Std. Err. t P> t [95% Conf. Interval].1145175.0061828 18.52 0.000.1023949.1266401 male.2601114.0205166 12.68 0.000.2198848.300338 _cons.1191529.0746591 1.60 0.111 -.0272301.2655358. test =.1051829 coef in SR ( 1) =.1051829 F( 1, 3291) = 2.28 Prob > F = 0.1312 * The point estimate of returns to ing is a bit higher, but statistically speaking not any different form that found in the simple regression of on sch.. predict yhatas (option xb assumed; fitted values). scatter yhatas, connect(l) ytitle("yhatas") yhatas.5 1 1.5 2 2.5
* SWITCHING REGRESSION (SR) MODEL: * Full interaction version:. regress male sch_m -------------+------------------------------ F( 3, 3290) = 151.69 Model 155.16947 3 51.7231567 Prob > F = 0.0000 Residual 1121.80942 3290.340975508 R-squared = 0.1215 -------------+------------------------------ Adj R-squared = 0.1207 Total 1276.97889 3293.387785876 Root MSE =.58393 Coef. Std. Err. t P> t [95% Conf. Interval].1210458.0095797 12.64 0.000.1022631.1398285 male.3907282.1478298 2.64 0.008.1008805.6805759 sch_m -.0111898.0125418-0.89 0.372 -.0357804.0134008 _cons.0418745.1143531 0.37 0.714 -.1823359.2660849. predict yhatsr (option xb assumed; fitted values) * Separate regressions version:. regress if male==0 Source SS df MS Number of obs = 1569 -------------+------------------------------ F( 1, 1567) = 149.81 Model 54.4406288 1 54.4406288 Prob > F = 0.0000 Residual 569.430435 1567.363388918 R-squared = 0.0873 -------------+------------------------------ Adj R-squared = 0.0867 Total 623.871063 1568.397876954 Root MSE =.60282 Coef. Std. Err. t P> t [95% Conf. Interval].1210458.0098895 12.24 0.000.1016477.1404438 _cons.0418745.1180517 0.35 0.723 -.1896814.2734304. regress if male==1 Source SS df MS Number of obs = 1725 -------------+------------------------------ F( 1, 1723) = 195.88 Model 62.7977306 1 62.7977306 Prob > F = 0.0000 Residual 552.378985 1723.320591402 R-squared = 0.1021 -------------+------------------------------ Adj R-squared = 0.1016 Total 615.176716 1724.356831042 Root MSE =.56621 Coef. Std. Err. t P> t [95% Conf. Interval].109856.0078492 14.00 0.000.0944609.125251 _cons.4326027.0908423 4.76 0.000.25443.6107755 * The point estimates of the returns to ing is higher by about 1% for females. But the slope difference is not statisticaly significant at conventional levels.
. scatter yhatsr, connect(l) ytitle("yhatsr") yhatsr.5 1 1.5 2 2.5. scatter yhatas, connect(l) ytitle("yhatas") yhatas.5 1 1.5 2 2.5
* EXPERIENCE PROFILE:. scatter exper 20 exper Q. Do you see a relationship between log-wages and years of experience? A. NO. * LINEAR REGRESSION:. regress exper -------------+------------------------------ F( 1, 3292) = 28.05 Model 10.7871684 1 10.7871684 Prob > F = 0.0000 Residual 1266.19172 3292.38462689 R-squared = 0.0084 -------------+------------------------------ Adj R-squared = 0.0081 Total 1276.97889 3293.387785876 Root MSE =.62018 Coef. Std. Err. t P> t [95% Conf. Interval] exper.024986.0047181 5.30 0.000.0157354.0342366 _cons 1.386295.0394577 35.13 0.000 1.308931 1.46366. predict yhatlr (option xb assumed; fitted values)
. scatter yhatlr exper,connect(. l) ytitle("yhatlr") yhatlr 20 exper Fitted values * QUADRATIC REGRESSION:. generate expsq=exper^2/100 * SHORT: ( omitted). regress exper expsq -------------+------------------------------ F( 2, 3291) = 36.93 Model 28.0320299 2 14.016015 Prob > F = 0.0000 Residual 1248.94686 3291.379503756 R-squared = 0.0220 -------------+------------------------------ Adj R-squared = 0.0214 Total 1276.97889 3293.387785876 Root MSE =.61604 Coef. Std. Err. t P> t [95% Conf. Interval] exper.1648016.0212641 7.75 0.000.1231094.2064937 expsq -.8504118.1261559-6.74 0.000-1.097764 -.6030598 _cons.8564965.0878248 9.75 0.000.6842998 1.028693 * There is very strong evidence that the experience profile is quadratic. Linear term > 0, quadratic term < 0 Concave profile. FOC:.165 2*0.85exp/100 = 0; exp* = 100(.165)/(2*0.85) = 9.7 years. SOC: < 0 we have a max.
. predict yhatqr (option xb assumed; fitted values). predict resex,residuals. scatter yhatqr exper,connect(. l) ytitle("yhatqr") sort yhatqr 20 exper Fitted values * Indeed peak is reached around exp = 9.7. * AUXILIARY REGRESSION OF on exp expsq:. regress exper expsq -------------+------------------------------ F( 2, 3291) = 265.40 Model 1256.55391 2 628.276957 Prob > F = 0.0000 Residual 7790.81372 3291 2.36730894 R-squared = 0.1389 -------------+------------------------------ Adj R-squared = 0.1384 Total 9047.36764 3293 2.74745449 Root MSE = 1.5386 Coef. Std. Err. t P> t [95% Conf. Interval] exper.8798059.0531087 16.57 0.000.7756764.9839353 expsq -6.20325.3150844-19.69 0.000-6.821032-5.585469 _cons 8.892577.2193494 40.54 0.000 8.462502 9.322653. predict ressch,residuals
* RESIDUAL REGRESSION RULE: * LONG:. regress exper expsq -------------+------------------------------ F( 3, 3290) = 123.09 Model 128.861193 3 42.9537309 Prob > F = 0.0000 Residual 1148.1177 3290.348971944 R-squared = 0.1009 -------------+------------------------------ Adj R-squared = 0.1001 Total 1276.97889 3293.387785876 Root MSE =.59074 Coef. Std. Err. t P> t [95% Conf. Interval] exper.0647121.0212239 3.05 0.002.0230986.1063255 expsq -.1447103.1279004-1.13 0.258 -.3954829.1060622.1137632.0066927 17.00 0.000.1006408.1268855 _cons -.1551513.103125-1.50 0.133 -.357347.0470444. regress ressch -------------+------------------------------ F( 1, 3292) = 282.22 Model 100.829163 1 100.829163 Prob > F = 0.0000 Residual 1176.14973 3292.35727513 R-squared = 0.0790 -------------+------------------------------ Adj R-squared = 0.0787 Total 1276.97889 3293.387785876 Root MSE =.59772 Coef. Std. Err. t P> t [95% Conf. Interval] ressch.1137632.0067719 16.80 0.000.1004856.1270407 _cons 1.587268.0104145 152.41 0.000 1.566849 1.607688. regress resex ressch -------------+------------------------------ F( 1, 3292) = 289.11 Model 100.829163 1 100.829163 Prob > F = 0.0000 Residual 1148.1177 3292.348759932 R-squared = 0.0807 -------------+------------------------------ Adj R-squared = 0.0805 Total 1248.94686 3293.379273265 Root MSE =.59056 resex Coef. Std. Err. t P> t [95% Conf. Interval] ressch.1137632.0066907 17.00 0.000.1006448.1268815 _cons 2.44e-15.0102897 0.00 1.000 -.0201748.0201748. sum resex ressch Variable Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- 3294 1.587268.6227246-2.569738 3.684091 resex 3294 5.56e-15.6158517-4.220615 2.21619 ressch 3294 2.97e-14 1.538139-6.487386 4.580719 * SLOPES are the same! (Why?)