------------------------------------------------------------------------------- log: d:\www\econ626\stata\treatment.log log type: text opened on: 6 Dec 2007, 06:56:32 . *read in stata data file; . use pums80; . * generate some new variables; . gen twoboys=boy1st*boy2nd; . gen twogirls=(1-boy1st)*(1-boy2nd); . * get descriptive statistics; . * 1980 married women sample; . * these are in column 3, Table 2; . * of angrist and evans; . sum; Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- kidcount | 254654 2.507799 .7693323 2 12 morekids | 254654 .3805634 .4855263 0 1 boy1st | 254654 .5143607 .4997947 0 1 boy2nd | 254654 .5125504 .4998434 0 1 samesex | 254654 .5055683 .49997 0 1 -------------+-------------------------------------------------------- multi2nd | 254654 .0083172 .0908186 0 1 agem1 | 254654 30.39327 3.386447 21 35 agefstm | 254654 20.83164 2.921183 15 33 black | 254654 .0516623 .2213447 0 1 hispan | 254654 .0742066 .2621073 0 1 -------------+-------------------------------------------------------- othrace | 254654 .0563431 .2305836 0 1 workedm | 254654 .5282187 .4992041 0 1 weeksm1 | 254654 19.01833 21.86728 0 52 hourswm | 254654 16.69856 18.33529 0 99 incomem | 254654 6250.416 10210.98 0 260308 -------------+-------------------------------------------------------- twoboys | 254654 .2662397 .4419919 0 1 twogirls | 254654 .2393287 .4266745 0 1 . * ols weeks worked model; . * this is from table 7, column 4 ; . * of angrist and evans; . reg weeksm1 morekids boy1st boy2nd agem1 agefstm black hispan othrace; Source | SS df MS Number of obs = 254654 -------------+------------------------------ F( 8,254645) = 2378.13 Model | 8465176.09 8 1058147.01 Prob > F = 0.0000 Residual | 113304239254645 444.94979 R-squared = 0.0695 -------------+------------------------------ Adj R-squared = 0.0695 Total | 121769415254653 478.177816 Root MSE = 21.094 ------------------------------------------------------------------------------ weeksm1 | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- morekids | -8.044995 .089585 -89.80 0.000 -8.22058 -7.869411 boy1st | -.0477043 .083645 -0.57 0.568 -.2116462 .1162377 boy2nd | -.1722542 .0836359 -2.06 0.039 -.3361784 -.00833 agem1 | 1.333901 .013781 96.79 0.000 1.306891 1.360912 agefstm | -1.357186 .0161703 -83.93 0.000 -1.388879 -1.325493 black | 10.83386 .189826 57.07 0.000 10.4618 11.20591 hispan | -.043496 .1770388 -0.25 0.806 -.3904874 .3034954 othrace | 2.82679 .2004528 14.10 0.000 2.433908 3.219672 _cons | 9.207843 .4190861 21.97 0.000 8.386445 10.02924 ------------------------------------------------------------------------------ . * OLS estimates of morekids model; . * married women sample; . * these numbers are in Table 6; . * column (5); . reg morekids samesex boy1st boy2nd agem1 agefstm black hispan othrace; Source | SS df MS Number of obs = 254654 -------------+------------------------------ F( 8,254645) = 2825.70 Model | 4894.61525 8 611.826907 Prob > F = 0.0000 Residual | 55136.2215254645 .216521909 R-squared = 0.0815 -------------+------------------------------ Adj R-squared = 0.0815 Total | 60030.8368254653 .235735832 Root MSE = .46532 ------------------------------------------------------------------------------ morekids | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- samesex | .0693854 .0018456 37.59 0.000 .065768 .0730028 boy1st | -.0111225 .0018456 -6.03 0.000 -.0147398 -.0075051 boy2nd | -.0095472 .0018456 -5.17 0.000 -.0131646 -.0059298 agem1 | .0304246 .000298 102.09 0.000 .0298405 .0310087 agefstm | -.0435676 .0003462 -125.85 0.000 -.0442461 -.0428891 black | .0679715 .0041853 16.24 0.000 .0597684 .0761747 hispan | .125998 .0038974 32.33 0.000 .1183591 .1336369 othrace | .0479479 .0044209 10.85 0.000 .039283 .0566127 _cons | .3234167 .0092616 34.92 0.000 .3052642 .3415692 ------------------------------------------------------------------------------ . * column (6); . * now run a probit version of the same equation; . dprobit morekids samesex boy1st boy2nd agem1 agefstm black hispan othrace; Iteration 0: log likelihood = -169176.65 Iteration 1: log likelihood = -158519.72 Iteration 2: log likelihood = -158479.6 Iteration 3: log likelihood = -158479.59 Probit regression, reporting marginal effects Number of obs = 254654 LR chi2(8) =21394.12 Prob > chi2 = 0.0000 Log likelihood = -158479.59 Pseudo R2 = 0.0632 ------------------------------------------------------------------------------ morekids | dF/dx Std. Err. z P>|z| x-bar [ 95% C.I. ] ---------+-------------------------------------------------------------------- samesex*| .0733133 .0019573 37.33 0.000 .505568 .069477 .077149 boy1st*| -.0116007 .0019669 -5.90 0.000 .514361 -.015456 -.007746 boy2nd*| -.0097034 .0019668 -4.93 0.000 .51255 -.013558 -.005849 agem1 | .03146 .0003201 98.21 0.000 30.3933 .030833 .032087 agefstm | -.0459977 .0003815 -120.28 0.000 20.8316 -.046745 -.04525 black*| .0713454 .0045662 15.89 0.000 .051662 .062396 .080295 hispan*| .133384 .0043003 31.53 0.000 .074207 .124956 .141813 othrace*| .0505783 .0048363 10.61 0.000 .056343 .041099 .060057 ---------+-------------------------------------------------------------------- obs. P | .3805634 pred. P | .3728648 (at x-bar) ------------------------------------------------------------------------------ (*) dF/dx is for discrete change of dummy variable from 0 to 1 z and P>|z| correspond to the test of the underlying coefficient being 0 . * the mismeasured treatment effect model; . * the syntax is treatreg y x, treat(t=x z) where y is the outcome; . * x is the list of exogenous factrors, t is the treatment variable; . * and z are the instruments; . treatreg weeksm1 boy1st boy2nd agem1 agefstm black hispan othrace, > treat(morekids=boy1st boy2nd agem1 agefstm black hispan othrace samesex); Iteration 0: log likelihood = -1296246.5 Iteration 1: log likelihood = -1296244.1 Iteration 2: log likelihood = -1296242.9 Iteration 3: log likelihood = -1296242.9 Treatment-effects model -- MLE Number of obs = 254654 Wald chi2(8) = 10945.43 Log likelihood = -1296242.9 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- weeksm1 | boy1st | -.0978209 .0849142 -1.15 0.249 -.2642498 .0686079 boy2nd | -.2126344 .0846625 -2.51 0.012 -.3785699 -.046699 agem1 | 1.495479 .0375763 39.80 0.000 1.42183 1.569127 agefstm | -1.588703 .0526184 -30.19 0.000 -1.691834 -1.485573 black | 11.19328 .2063143 54.25 0.000 10.78891 11.59765 hispan | .6271033 .2297407 2.73 0.006 .1768199 1.077387 othrace | 3.080383 .2091413 14.73 0.000 2.670473 3.490292 morekids | -13.36466 1.153232 -11.59 0.000 -15.62495 -11.10436 _cons | 11.10818 .5888452 18.86 0.000 9.95407 12.2623 -------------+---------------------------------------------------------------- morekids | boy1st | -.0304351 .0051948 -5.86 0.000 -.0406167 -.0202534 boy2nd | -.0255595 .0051945 -4.92 0.000 -.0357405 -.0153785 agem1 | .0831814 .0008466 98.26 0.000 .0815222 .0848407 agefstm | -.1216179 .0010104 -120.36 0.000 -.1235983 -.1196374 black | .1854887 .0115896 16.00 0.000 .1627734 .2082039 hispan | .3408726 .0108201 31.50 0.000 .3196657 .3620796 othrace | .1314511 .0123751 10.62 0.000 .1071963 .1557059 samesex | .190075 .0053541 35.50 0.000 .1795813 .2005688 _cons | -.4289577 .0264053 -16.25 0.000 -.4807112 -.3772042 -------------+---------------------------------------------------------------- /athrho | .1547689 .0335107 4.62 0.000 .0890892 .2204487 /lnsigma | 3.055839 .0032757 932.88 0.000 3.049419 3.062259 -------------+---------------------------------------------------------------- rho | .1535449 .0327206 .0888543 .2169456 sigma | 21.239 .0695729 21.10307 21.3758 lambda | 3.26114 .704624 1.880103 4.642178 ------------------------------------------------------------------------------ LR test of indep. eqns. (rho = 0): chi2(1) = 11.43 Prob > chi2 = 0.0007 ------------------------------------------------------------------------------ . * now compare this estimate with an IV model where same sex is used; . * as an instrument for morekids; . reg weeksm1 morekids boy1st boy2nd agem1 agefstm black hispan othrace > (samesex boy1st boy2nd agem1 agefstm black hispan othrace); Instrumental variables (2SLS) regression Source | SS df MS Number of obs = 254654 -------------+------------------------------ F( 8,254645) = 1367.88 Model | 8077637.52 8 1009704.69 Prob > F = 0.0000 Residual | 113691778254645 446.471668 R-squared = 0.0663 -------------+------------------------------ Adj R-squared = 0.0663 Total | 121769415254653 478.177816 Root MSE = 21.13 ------------------------------------------------------------------------------ weeksm1 | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- morekids | -5.401144 1.207881 -4.47 0.000 -7.768559 -3.033729 boy1st | -.0227965 .0845529 -0.27 0.787 -.1885179 .1429249 boy2nd | -.1521854 .0842763 -1.81 0.071 -.3173647 .012994 agem1 | 1.253598 .039104 32.06 0.000 1.176955 1.330241 agefstm | -1.242123 .0548684 -22.64 0.000 -1.349664 -1.134582 black | 10.65523 .2068347 51.52 0.000 10.24984 11.06062 hispan | -.3767812 .2334672 -1.61 0.107 -.8343707 .0808084 othrace | 2.700756 .2088444 12.93 0.000 2.291426 3.110085 _cons | 8.26338 .601158 13.75 0.000 7.085126 9.441634 ------------------------------------------------------------------------------ . * what does the model look like when the model is identified solely; . * by non-linearities, that is, z is not used; . treatreg weeksm1 boy1st boy2nd agem1 agefstm black hispan othrace, > treat(morekids=boy1st boy2nd agem1 agefstm black hispan othrace); Iteration 0: log likelihood = -1296956.4 Iteration 1: log likelihood = -1296918.8 Iteration 2: log likelihood = -1296902.4 Iteration 3: log likelihood = -1296902.4 Iteration 4: log likelihood = -1296902.4 Treatment-effects model -- MLE Number of obs = 254654 Wald chi2(8) = 10912.18 Log likelihood = -1296902.4 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- weeksm1 | boy1st | -.1542016 .086537 -1.78 0.075 -.323811 .0154079 boy2nd | -.2580619 .0864163 -2.99 0.003 -.4274346 -.0886891 agem1 | 1.677252 .0278043 60.32 0.000 1.622757 1.731747 agefstm | -1.849158 .0380884 -48.55 0.000 -1.92381 -1.774507 black | 11.59762 .2027623 57.20 0.000 11.20022 11.99503 hispan | 1.381521 .2077066 6.65 0.000 .9744238 1.788619 othrace | 3.365673 .2099989 16.03 0.000 2.954082 3.777263 morekids | -19.34923 .7923236 -24.42 0.000 -20.90216 -17.7963 _cons | 13.24605 .515396 25.70 0.000 12.2359 14.25621 -------------+---------------------------------------------------------------- morekids | boy1st | -.0259139 .0051784 -5.00 0.000 -.0360634 -.0157644 boy2nd | -.0208027 .005178 -4.02 0.000 -.0309514 -.0106539 agem1 | .0827105 .0008448 97.90 0.000 .0810547 .0843664 agefstm | -.1209982 .0010075 -120.09 0.000 -.122973 -.1190235 black | .1846632 .0115541 15.98 0.000 .1620175 .2073088 hispan | .3385704 .0107911 31.37 0.000 .3174202 .3597207 othrace | .1298468 .012332 10.53 0.000 .1056766 .154017 _cons | -.3350242 .0262171 -12.78 0.000 -.3864088 -.2836396 -------------+---------------------------------------------------------------- /athrho | .3285007 .0230767 14.24 0.000 .2832713 .3737301 /lnsigma | 3.079289 .0043563 706.86 0.000 3.070751 3.087827 -------------+---------------------------------------------------------------- rho | .317173 .0207552 .27593 .3572501 sigma | 21.74293 .0947179 21.55808 21.92937 lambda | 6.89627 .4798207 5.955839 7.836701 ------------------------------------------------------------------------------ LR test of indep. eqns. (rho = 0): chi2(1) = 88.79 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ . exit, clear