---------------------------------------------------------------------------------------------------------------- log: C:\Documents and Settings\jlee\My Documents\EC671\heckman_treatment.log log type: text opened on: 6 Nov 2004, 21:23:05 . . *** Heckman Selection Models . . use http://www.stata-press.com/data/r8/womenwk, clear . generate d = 1 . replace d = 0 if wage == . (657 real changes made) . . heckman wage educ age, select (married children educ age) twostep Heckman selection model -- two-step estimates Number of obs = 2000 (regression model with sample selection) Censored obs = 657 Uncensored obs = 1343 Wald chi2(4) = 551.37 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- wage | education | .9825259 .0538821 18.23 0.000 .8769189 1.088133 age | .2118695 .0220511 9.61 0.000 .1686502 .2550888 _cons | .7340391 1.248331 0.59 0.557 -1.712645 3.180723 -------------+---------------------------------------------------------------- select | married | .4308575 .074208 5.81 0.000 .2854125 .5763025 children | .4473249 .0287417 15.56 0.000 .3909922 .5036576 education | .0583645 .0109742 5.32 0.000 .0368555 .0798735 age | .0347211 .0042293 8.21 0.000 .0264318 .0430105 _cons | -2.467365 .1925635 -12.81 0.000 -2.844782 -2.089948 -------------+---------------------------------------------------------------- mills | lambda | 4.001615 .6065388 6.60 0.000 2.812821 5.19041 -------------+---------------------------------------------------------------- rho | 0.67284 sigma | 5.9473529 lambda | 4.0016155 .6065388 ------------------------------------------------------------------------------ . heckman wage educ age, select (married children educ age) nolog Heckman selection model Number of obs = 2000 (regression model with sample selection) Censored obs = 657 Uncensored obs = 1343 Wald chi2(2) = 508.44 Log likelihood = -5178.304 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- wage | education | .9899537 .0532565 18.59 0.000 .8855729 1.094334 age | .2131294 .0206031 10.34 0.000 .1727481 .2535108 _cons | .4857752 1.077037 0.45 0.652 -1.625179 2.59673 -------------+---------------------------------------------------------------- select | married | .4451721 .0673954 6.61 0.000 .3130794 .5772647 children | .4387068 .0277828 15.79 0.000 .3842534 .4931601 education | .0557318 .0107349 5.19 0.000 .0346917 .0767718 age | .0365098 .0041533 8.79 0.000 .0283694 .0446502 _cons | -2.491015 .1893402 -13.16 0.000 -2.862115 -2.119915 -------------+---------------------------------------------------------------- /athrho | .8742086 .1014225 8.62 0.000 .6754241 1.072993 /lnsigma | 1.792559 .027598 64.95 0.000 1.738468 1.84665 -------------+---------------------------------------------------------------- rho | .7035061 .0512264 .5885365 .7905862 sigma | 6.004797 .1657202 5.68862 6.338548 lambda | 4.224412 .3992265 3.441942 5.006881 ------------------------------------------------------------------------------ LR test of indep. eqns. (rho = 0): chi2(1) = 61.20 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ . . *heckman wage educ age, select (d = married children educ age) twostep nolog . *probit d married children educ age, nolog . . predict cndwage, ycond . summarize wage cndwage if wage < . Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- wage | 1343 23.69217 6.305374 5.88497 45.80979 cndwage | 1343 23.68239 3.335087 16.18337 33.7567 . . predict expwage, yexpected . gen wage0 = wage (657 missing values generated) . replace wage0 = 0 if wage >= . (657 real changes made) . summarize wage0 expwage Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- wage0 | 2000 15.90929 12.27081 0 45.80979 expwage | 2000 15.92511 5.979336 2.492469 32.45858 . . . *** Heckprob . . use http://www.stata-press.com/data/r8/school, clear . . tab private vote | vote private | 0 1 | Total -----------+----------------------+---------- 0 | 31 54 | 85 1 | 5 5 | 10 -----------+----------------------+---------- Total | 36 59 | 95 . heckprob private years logptax, sel (vote = years loginc logptax) nolog Probit model with sample selection Number of obs = 95 Censored obs = 36 Uncensored obs = 59 Wald chi2(2) = 1.04 Log likelihood = -74.24497 Prob > chi2 = 0.5935 ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- private | years | -.1142597 .1461711 -0.78 0.434 -.4007498 .1722304 logptax | .3516095 1.01648 0.35 0.729 -1.640655 2.343874 _cons | -2.780664 6.905814 -0.40 0.687 -16.31581 10.75448 -------------+---------------------------------------------------------------- vote | years | -.0167511 .0147735 -1.13 0.257 -.0457067 .0122045 loginc | .9923025 .4430003 2.24 0.025 .1240378 1.860567 logptax | -1.278783 .5717544 -2.24 0.025 -2.399401 -.1581649 _cons | -.5458214 4.070415 -0.13 0.893 -8.523689 7.432046 -------------+---------------------------------------------------------------- /athrho | -.8663147 1.449995 -0.60 0.550 -3.708253 1.975623 -------------+---------------------------------------------------------------- rho | -.6994969 .7405184 -.9987982 .9622643 ------------------------------------------------------------------------------ LR test of indep. eqns. (rho = 0): chi2(1) = 0.27 Prob > chi2 = 0.6020 ------------------------------------------------------------------------------ . heckprob private years logptax, sel (vote = years loginc logptax) robust nolog Probit model with sample selection Number of obs = 95 Censored obs = 36 Uncensored obs = 59 Wald chi2(2) = 2.55 Log pseudo-likelihood = -74.24497 Prob > chi2 = 0.2798 ------------------------------------------------------------------------------ | Robust | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- private | years | -.1142597 .1113949 -1.03 0.305 -.3325896 .1040702 logptax | .3516095 .735811 0.48 0.633 -1.090554 1.793773 _cons | -2.780664 4.786602 -0.58 0.561 -12.16223 6.600903 -------------+---------------------------------------------------------------- vote | years | -.0167511 .0173344 -0.97 0.334 -.0507258 .0172237 loginc | .9923025 .4228035 2.35 0.019 .1636229 1.820982 logptax | -1.278783 .5095157 -2.51 0.012 -2.277416 -.2801505 _cons | -.5458214 4.543884 -0.12 0.904 -9.45167 8.360027 -------------+---------------------------------------------------------------- /athrho | -.8663147 1.630569 -0.53 0.595 -4.062171 2.329541 -------------+---------------------------------------------------------------- rho | -.6994969 .8327382 -.9994077 .9812276 ------------------------------------------------------------------------------ Wald test of indep. eqns. (rho = 0): chi2(1) = 0.28 Prob > chi2 = 0.5952 ------------------------------------------------------------------------------ . . . . *** Treatment effects model . . use http://www.stata-press.com/data/r8/labor, replace . generate wc = 0 . replace wc = 1 if we > 12 (69 real changes made) . tab wc wc | Freq. Percent Cum. ------------+----------------------------------- 0 | 181 72.40 72.40 1 | 69 27.60 100.00 ------------+----------------------------------- Total | 250 100.00 . regress ww wa cit wc Source | SS df MS Number of obs = 250 -------------+------------------------------ F( 3, 246) = 4.82 Model | 93.2398568 3 31.0799523 Prob > F = 0.0028 Residual | 1587.08776 246 6.45157627 R-squared = 0.0555 -------------+------------------------------ Adj R-squared = 0.0440 Total | 1680.32762 249 6.74830369 Root MSE = 2.54 ------------------------------------------------------------------------------ ww | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- wa | -.0104985 .0192667 -0.54 0.586 -.0484472 .0274502 cit | .1278922 .3389058 0.38 0.706 -.5396351 .7954195 wc | 1.332192 .3644344 3.66 0.000 .6143819 2.050001 _cons | 2.278337 .8432385 2.70 0.007 .6174489 3.939225 ------------------------------------------------------------------------------ . . treatreg ww wa cit, treat(wc = wmed wfed) twostep nolog Treatment effects model -- two-step estimates Number of obs = 250 Wald chi2(3) = 3.67 Prob > chi2 = 0.2998 ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- ww | wa | -.0111623 .020152 -0.55 0.580 -.0506594 .0283348 cit | .1276102 .33619 0.38 0.704 -.53131 .7865305 wc | 1.257995 .8007428 1.57 0.116 -.3114319 2.827422 _cons | 2.327482 .9610271 2.42 0.015 .4439031 4.21106 -------------+---------------------------------------------------------------- wc | wmed | .1198888 .0319859 3.75 0.000 .0571976 .1825801 wfed | .0960764 .0290581 3.31 0.001 .0391236 .1530292 _cons | -2.631496 .3308344 -7.95 0.000 -3.279919 -1.983072 -------------+---------------------------------------------------------------- hazard | lambda | .0548738 .5283928 0.10 0.917 -.9807571 1.090505 -------------+---------------------------------------------------------------- rho | 0.02178 sigma | 2.5198211 lambda | .05487379 .5283928 ------------------------------------------------------------------------------ . predict wwctrt, yctrt . predict wwcntrt, ycntrt . generate diff = wwctrt - wwcntrt . summarize diff Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- diff | 250 1.356912 .0134202 1.34558 1.420173 . ttest wwctrt = wwcntrt, unequal unpaired Two-sample t test with unequal variances ------------------------------------------------------------------------------ Variable | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- wwctrt | 250 3.259108 .0064269 .101618 3.24645 3.271766 wwcntrt | 250 1.902196 .0064969 .1027242 1.8894 1.914992 ---------+-------------------------------------------------------------------- combined | 500 2.580652 .030713 .6867629 2.520309 2.640994 ---------+-------------------------------------------------------------------- diff | 1.356912 .0091386 1.338957 1.374867 ------------------------------------------------------------------------------ Satterthwaite's degrees of freedom: 497.942 Ho: mean(wwctrt) - mean(wwcntrt) = diff = 0 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 t = 148.4814 t = 148.4814 t = 148.4814 P < t = 1.0000 P > |t| = 0.0000 P > t = 0.0000 . . drop wwctrt wwcntrt diff . . treatreg ww wa cit, treat(wc = wmed wfed) nolog Treatment effects model -- MLE Number of obs = 250 Wald chi2(3) = 4.11 Log likelihood = -707.07215 Prob > chi2 = 0.2501 ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- ww | wa | -.0110424 .0199652 -0.55 0.580 -.0501735 .0280887 cit | .127636 .3361938 0.38 0.704 -.5312917 .7865638 wc | 1.271327 .7412951 1.72 0.086 -.1815842 2.724239 _cons | 2.318638 .9397573 2.47 0.014 .4767478 4.160529 -------------+---------------------------------------------------------------- wc | wmed | .1198055 .0320056 3.74 0.000 .0570757 .1825352 wfed | .0961886 .0290868 3.31 0.001 .0391795 .1531977 _cons | -2.631876 .3309128 -7.95 0.000 -3.280453 -1.983299 -------------+---------------------------------------------------------------- /athrho | .0178668 .1899898 0.09 0.925 -.3545063 .3902399 /lnsigma | .9241584 .0447455 20.65 0.000 .8364588 1.011858 -------------+---------------------------------------------------------------- rho | .0178649 .1899291 -.3403659 .371567 sigma | 2.519747 .1127473 2.308179 2.750707 lambda | .0450149 .4786442 -.8931105 .9831404 ------------------------------------------------------------------------------ LR test of indep. eqns. (rho = 0): chi2(1) = 0.01 Prob > chi2 = 0.9251 ------------------------------------------------------------------------------ . predict wwctrt, yctrt . predict wwcntrt, ycntrt . generate diff = wwctrt - wwcntrt . summarize diff Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- diff | 250 1.352476 .0110119 1.343176 1.404383 . ttest wwctrt = wwcntrt, unequal unpaired Two-sample t test with unequal variances ------------------------------------------------------------------------------ Variable | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- wwctrt | 250 3.255635 .0063887 .1010147 3.243052 3.268218 wwcntrt | 250 1.903159 .0064669 .1022504 1.890422 1.915896 ---------+-------------------------------------------------------------------- combined | 500 2.579397 .0306112 .6844875 2.519254 2.63954 ---------+-------------------------------------------------------------------- diff | 1.352476 .0090905 1.334616 1.370336 ------------------------------------------------------------------------------ Satterthwaite's degrees of freedom: 497.926 Ho: mean(wwctrt) - mean(wwcntrt) = diff = 0 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 t = 148.7798 t = 148.7798 t = 148.7798 P < t = 1.0000 P > |t| = 0.0000 P > t = 0.0000 . . . end of do-file . exit, clear