------------------------------------------------------------------------------- log: d:\bill\fall2008\econ30331\educ_earn.log log type: text opened on: 10 Sep 2008, 10:26:27 . . * the data set is big so increase memory . set memory 2m Current memory allocation current memory usage settable value description (1M = 1024k) -------------------------------------------------------------------- set maxvar 5000 max. variables allowed 1.909M set memory 2M max. data space 2.000M set matsize 400 max. RHS vars in models 1.254M ----------- 5.163M . . * read in data . * this is the data set from the intro to . * stata handout . use cps87 . . * construct ln weekly earnings . gen ln_weekly_earn=ln(weekly_earn) . . * get descriptive information . sum weekly_earn ln_weekly_earn years_educ Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- weekly_earn | 19906 488.264 236.4713 60 999 ln_weekly_~n | 19906 6.067307 .513047 4.094345 6.906755 years_educ | 19906 13.16126 2.795234 0 18 . . * run simple regression . reg ln_weekly_earn years_educ Source | SS df MS Number of obs = 19906 -------------+------------------------------ F( 1, 19904) = 3877.62 Model | 854.28055 1 854.28055 Prob > F = 0.0000 Residual | 4385.05814 19904 .220310397 R-squared = 0.1631 -------------+------------------------------ Adj R-squared = 0.1630 Total | 5239.33869 19905 .263217216 Root MSE = .46937 ------------------------------------------------------------------------------ ln_weekly_~n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- years_educ | .0741141 .0011902 62.27 0.000 .0717813 .076447 _cons | 5.091872 .0160138 317.97 0.000 5.060484 5.123261 ------------------------------------------------------------------------------ . . * generate new variable for age squared . gen age2=age*age . . * run regression controlling for . * educ and quadratic in age . reg ln_weekly_earn years_educ age age2 Source | SS df MS Number of obs = 19906 -------------+------------------------------ F( 3, 19902) = 2644.18 Model | 1493.15489 3 497.718296 Prob > F = 0.0000 Residual | 3746.1838 19902 .188231524 R-squared = 0.2850 -------------+------------------------------ Adj R-squared = 0.2849 Total | 5239.33869 19905 .263217216 Root MSE = .43386 ------------------------------------------------------------------------------ ln_weekly_~n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- years_educ | .0719499 .0011135 64.62 0.000 .0697674 .0741324 age | .0712533 .0020266 35.16 0.000 .067281 .0752256 age2 | -.0007069 .0000248 -28.51 0.000 -.0007555 -.0006583 _cons | 3.522066 .0397997 88.49 0.000 3.444055 3.600077 ------------------------------------------------------------------------------ . . log close log: d:\bill\fall2008\econ30331\educ_earn.log log type: text closed on: 10 Sep 2008, 10:26:27 -------------------------------------------------------------------------------