options crt; ? 5e6 ? In this exercise, we repeat the same code for both 1978 and 1985. ? Contrast with 5e7, where both years are done with a dot loop ? over the unduplicated code. The code in 5e6 is easier to create - ? just get it working for 1978, then duplicate the code, and make a ? few changes for 1985. But if you have to modify the common code at ? a later time, the 5e7 method is better, because you only have to make ? the changes in one place, instead of in two places. in cps78; set n=550; smpl 1,n; olsq lnwage c fe union nonwh hisp ed ex exsq; rename @ssr ssru; set s2u = @s*@s; nonorhis = nonwh + hisp; olsq lnwage c fe union nonorhis ed ex exsq; set df1=1; set df2 = n-8; set fsta = (@ssr-ssru)/s2u; cdf(F,df1=df1,df2=df2) fsta; ? (a) ? other = 1 - nonwh - hisp; supres smpl; dot nonwh hisp other; select . ; msd lnwage fe union ed ex exsq; ? for (b) set mlw. = @mean(1); set @mean(1) = 1; ? for (e) -- to multiply constant term rename @mean m. ; olsq lnwage c fe union ed ex exsq; ? for (c) rename @coef b. ; rename @vcov v. ; rename @ssr s. ; ? for (d) enddot; set dlwon = mlwother - mlwnonwh; set dlwoh = mlwother - mlwhisp; mat dmon = mother-mnonwh; mat dmoh = mother-mhisp; print dlwon dlwoh dmon dmoh; ? (b) smpl 1,6; unmake mother c1; unmake mnonwh c2; unmake mhisp c3; mmake mall c1-c3; print mall; ? (b) matrix of means for easier comparison smpl 1,n; supres; ? ? Use the same method as in 5e5, to compute not only the wage ? differentials, but the standard errors and t-statistics for them. ? title 'other vs. nonwhite'; mat don = bother-bnonwh; mat vdon = vother+vnonwh; tstats(names=@rnms) don vdon; title 'other vs. hispanic'; mat doh = bother-bhisp; mat vdoh = vother+vhisp; tstats(names=@rnms) doh vdoh; title 'nonwhite vs. hispanic'; mat dnh = bnonwh-bhisp; mat vdnh = vnonwh+vhisp; tstats(names=@rnms) dnh vdnh; ? (c) ? olsq lnwage c fe union ed ex exsq; set ssru = sother+snonwh+shisp; set df1 = 2*6; set df2 = n-3*6; set fstd1 = ((@ssr-ssru)/df1)/(ssru/df2); cdf(F,df1=df1,df2=df2) fstd1; ? (d - first part) supres smpl; select nonorhis; olsq lnwage c fe union ed ex exsq; set ssru = snonwh+shisp; set df1 = 6; set df2 = @nob-2*6; set fstd2 = ((@ssr-ssru)/df1)/(ssru/df2); cdf(F,df1=df1,df2=df2) fstd2; ? (d - second part) select 1; supres; ? mat dendon = bother'dmon; mat discon = mnonwh'don; set sumon = dendon + discon; print dendon discon sumon dlwon; ? (e) set propend = dendon/sumon; print propend; mat dendi = bother % dmon; ? element-by-element (Hadamard) product print dendi; ? breakdown for each endowment ? mat dendoh = bother'dmoh; mat discoh = mhisp'doh; set sumoh = dendoh + discoh; print dendoh discoh sumoh dlwoh; ? (f) set propend = dendoh/sumoh; print propend; mat dendi = bother % dmoh; print dendi; ? breakdown for each endowment ? mat dendong = bnonwh'dmon; mat discong = mother'don; print dendong discong; ? (g - part 1) set propendg = dendong/dlwon; print propendg; mat dendohg = bhisp'dmoh; mat discohg = mother'doh; print dendohg discohg; ? (g - part 2) set propendg = dendohg/dlwoh; print propendg; ? ? delete lnwage fe nonwh hisp ed ex exsq union other nonorhis; in cps85; set n=534; smpl 1,n; olsq lnwage c fe union nonwh hisp ed ex exsq; rename @ssr ssru; set s2u = @s*@s; nonorhis = nonwh + hisp; olsq lnwage c fe union nonorhis ed ex exsq; set df1=1; set df2 = n-8; set fsta = (@ssr-ssru)/s2u; cdf(F,df1=df1,df2=df2) fsta; ? (a) ? other = 1 - nonwh - hisp; supres smpl; dot nonwh hisp other; select . ; msd lnwage fe union ed ex exsq; ? for (b) set mlw. = @mean(1); set @mean(1) = 1; ? for (e) -- to multiply constant term rename @mean m. ; olsq lnwage c fe union ed ex exsq; ? for (c) rename @coef b. ; rename @vcov v. ; rename @ssr s. ; ? for (d) enddot; set dlwon = mlwother - mlwnonwh; set dlwoh = mlwother - mlwhisp; mat dmon = mother-mnonwh; mat dmoh = mother-mhisp; print dlwon dlwoh dmon dmoh; ? (b) smpl 1,6; unmake mother c1; unmake mnonwh c2; unmake mhisp c3; mmake mall c1-c3; print mall; ? (b) matrix of means for easier comparison smpl 1,n; supres; ? title 'other vs. nonwhite'; mat don = bother-bnonwh; mat vdon = vother+vnonwh; tstats(names=@rnms) don vdon; title 'other vs. hispanic'; mat doh = bother-bhisp; mat vdoh = vother+vhisp; tstats(names=@rnms) doh vdoh; title 'nonwhite vs. hispanic'; mat dnh = bnonwh-bhisp; mat vdnh = vnonwh+vhisp; tstats(names=@rnms) dnh vdnh; ? (c) ? olsq lnwage c fe union ed ex exsq; set ssru = sother+snonwh+shisp; set df1 = 2*6; set df2 = n-3*6; set fstd1 = ((@ssr-ssru)/df1)/(ssru/df2); cdf(F,df1=df1,df2=df2) fstd1; ? (d - first part) supres smpl; select nonorhis; olsq lnwage c fe union ed ex exsq; set ssru = snonwh+shisp; set df1 = 6; set df2 = @nob-2*6; set fstd2 = ((@ssr-ssru)/df1)/(ssru/df2); cdf(F,df1=df1,df2=df2) fstd2; ? (d - second part) select 1; supres; ? mat dendon = bother'dmon; mat discon = mnonwh'don; set sumon = dendon + discon; print dendon discon sumon dlwon; ? (e) set propend = dendon/sumon; print propend; mat dendi = bother % dmon; print dendi; ? breakdown for each endowment ? mat dendoh = bother'dmoh; mat discoh = mhisp'doh; set sumoh = dendoh + discoh; print dendoh discoh sumoh dlwoh; ? (f) set propend = dendoh/sumoh; print propend; mat dendi = bother % dmoh; print dendi; ? breakdown for each endowment ? mat dendong = bnonwh'dmon; mat discong = mother'don; print dendong discong; ? (g - part 1) set propendg = dendong/dlwon; print propendg; mat dendohg = bhisp'dmoh; mat discohg = mother'doh; print dendohg discohg; ? (g - part 2) set propendg = dendohg/dlwoh; print propendg;