13.07.2015 Views

Illustrative Answer 1. Regression diagnostics for ever-married Black

Illustrative Answer 1. Regression diagnostics for ever-married Black

Illustrative Answer 1. Regression diagnostics for ever-married Black

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

quite late (again relative to others of the same sex). It is probable that these few casesare distorting the relationship between education and age-at-first marriage that holds<strong>for</strong> the bulk of the sample. This suggests that a robust regression estimate may besuperior.C. The robust regression estimate confirms the suspicion that the handful of poorly educatedpersons who <strong>married</strong> very late distorts the overall pattern. Down-weighting outliers,which is what the robust regression procedure does, produces a much more plausible setof estimates: each year of education results in an increase of about half a year in the ageat first marriage, net of sex; males marry about 3 ½ years later than females, net ofeducation; both coefficients are highly significant; and the intercept suggests that themost poorly educated women marry quite early—<strong>for</strong> example, the predicted age at firstmarriage <strong>for</strong> <strong>Black</strong> <strong>ever</strong>-<strong>married</strong> women with an 8 th grade education is 18.6(=14.2+.55*8). In my judgement, the robust regression estimate produces the result weshould accept.D. The robust regression procedure assigns weights of < .5 to 8 cases. Three cases areassigned weights of zero: a male with one year of schooling who first <strong>married</strong> at age 49, amale with 8 years of schooling who first <strong>married</strong> at age 56, and a female with 11 years ofschooling who first <strong>married</strong> at age 54. Three other persons were assigned weights < .1,one person a weight of .27, and one person a weight of .36. All of these people <strong>married</strong>at age 34 or later, well after the overwhelming majority of persons who would <strong>ever</strong> marryhad <strong>married</strong>, and none of them had more than 12 years of schooling.E. Figs. 4a and 4b show the OLS and robust regression lines relating age at first marriage toeducation, and the observed points, separately <strong>for</strong> males and females. As we know fromthe above discussion, the robust regression slopes are positive, showing that therelationship between education and age at first marriage is generally the same <strong>for</strong> <strong>Black</strong>sas it is known to be <strong>for</strong> the entire population. By contrast, the OLS estimates aremisleading, since they are distorted by a handful of deviant cases, persons of loweducation who <strong>married</strong> late in life.10.2


5550OLS predictionRobust predictionObserved age45Age at First Marriage4035302520150 4 8 12 16 20Years of SchoolingFig. 4b.OLS and Robust <strong>Regression</strong> Predictions of Age at First Marriage from Years ofSchooling, Ever-<strong>married</strong> <strong>Black</strong> Females, U.S. 1994.10.7


Stata Log <strong>for</strong> Ex. 10--------------------------------------------------------------------------------log: d:\teach\soc212ab\2007-2008\computing\ex1<strong>1.</strong>loglog type: textopened on: 18 Jan 2008, 06:50:49#delimit ;delimiter now ;version 10.0;clear;set more 1;program drop _all;set mem 100m;Current memory allocationcurrentmemory usagesettable value description (1M = 1024k)--------------------------------------------------------------------set maxvar 5000 max. variables allowed <strong>1.</strong>909Mset memory 100M max. data space 100.000Mset matsize 400 max. RHS vars in models <strong>1.</strong>254M-----------103.163Mset linesize 80;set scheme lean1,permanent;(set scheme preference recorded)***********************> *<strong>Regression</strong> <strong>diagnostics</strong>> ***********************;*A. Regress age at first marriage on years of schooling and sex <strong>for</strong> <strong>ever</strong>-<strong>married</strong>> <strong>Black</strong>s.;gen male = 1;replace male=0 if sex==2;(1702 real changes made)*Mark the good data.;mark good if race==2 & agewed>0 & agewed0 & agewed


mlcolor(black) saving(ex11_2b.gph,replace);(note: file ex11_2b.gph not found)(file ex11_2b.gph saved)*Trouble. There are some clear outliers here. See what the> added variable (partial residual) plots show.;avplots,jitter(1) mlabsize(medium) mlcolor(black)> mlwidth(medthick) rlopts(clwidth(medthick))> saving(ex11_2c.gph,replace);(note: file ex11_2c.gph not found)(file ex11_2c.gph saved)*The plot relating the residuals from the prediction of education> from gender to the residuals from the prediction of age-at-first-> marriage from gender suggest the trouble: a few poorly educated> people <strong>married</strong> very late, distorting the general pattern.> Try to correct this by doing a robust regression;> *C. Robust regression;rreg agewed educ male if race==2 & agewed>0 & agewed F = 0.0000------------------------------------------------------------------------------agewed | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+----------------------------------------------------------------educ | .5491989 .1089462 5.04 0.000 .3335977 .7648002male | 3.540433 .7778366 4.55 0.000 2.001117 5.079748_cons | 14.171 <strong>1.</strong>416216 10.01 0.000 1<strong>1.</strong>36835 16.97365------------------------------------------------------------------------------predict xragewed;(option xb assumed; fitted values)(7 missing values generated)*The robust regression results are as we might reasonably expect.> Each additional year of schooling implies an expected delay in> marriage of something over half a year, and males marry about> 3 1/2 years later than do females.;*D. Get the detail on the weight variable to see which individuals> were downweighted by the robust procedure.;sum wt,detail;10.10


Robust <strong>Regression</strong> Weight-------------------------------------------------------------Percentiles Smallest1% 0 05% .2705684 010% .7634072 0 Obs 12925% .8982747 .0170275 Sum of Wgt. 12950% .9522914 Mean .887426Largest Std. Dev. .216987875% .9912887 .999739290% .9983673 .9997392 Variance .047083795% .9995673 .9999363 Skewness -3.20967199% .9999363 .9999979 Kurtosis 12.58876*Three cases were given zero weight. Get the distribution of weights.;tab wt;Robust |<strong>Regression</strong> |Weight | Freq. Percent Cum.------------+-----------------------------------0 | 3 2.33 2.33.0170275 | 1 0.78 3.10.0547351 | 1 0.78 3.88.0979649 | 1 0.78 4.65.2705684 | 1 0.78 5.43.3557015 | 1 0.78 6.20.6072693 | 1 0.78 6.98.6885336 | 1 0.78 7.75.7461758 | 1 0.78 8.53.7618496 | 1 0.78 9.30.7634072 | 1 0.78 10.08.7732537 | 1 0.78 10.85.7842262 | 1 0.78 1<strong>1.</strong>63.8148157 | 1 0.78 12.40.8150163 | 1 0.78 13.18.8251965 | 1 0.78 13.95.8435303 | 1 0.78 14.73.8483481 | 1 0.78 15.50.8562631 | 1 0.78 16.28.8609051 | 1 0.78 17.05.8654801 | 1 0.78 17.83.8700648 | 1 0.78 18.60.8745028 | 2 <strong>1.</strong>55 20.16.8847181 | 1 0.78 20.93.8942335 | 1 0.78 2<strong>1.</strong>7<strong>1.</strong>8972721 | 1 0.78 22.48.8982747 | 4 3.10 25.58.8984289 | 1 0.78 26.36.901107 | 1 0.78 27.13.9088688 | 1 0.78 27.9<strong>1.</strong>9116251 | 1 0.78 28.68.9127042 | 1 0.78 29.46.9162588 | 1 0.78 30.23.9163998 | 3 2.33 32.56.9189847 | 1 0.78 33.3310.11


.9225524 | 4 3.10 36.43.9235669 | 1 0.78 37.2<strong>1.</strong>9260448 | 1 0.78 37.98.9292593 | 2 <strong>1.</strong>55 39.53.9326041 | 1 0.78 40.3<strong>1.</strong>934938 | 1 0.78 4<strong>1.</strong>09.9390633 | 1 0.78 4<strong>1.</strong>86.9412872 | 1 0.78 42.64.9421768 | 1 0.78 43.4<strong>1.</strong>9443452 | 1 0.78 44.19.9465253 | 1 0.78 44.96.9473759 | 1 0.78 45.74.9501654 | 1 0.78 46.5<strong>1.</strong>9502757 | 4 3.10 49.6<strong>1.</strong>9522914 | 1 0.78 50.39.9627207 | 1 0.78 5<strong>1.</strong>16.9645652 | 1 0.78 5<strong>1.</strong>94.9651691 | 4 3.10 55.04.9669529 | 1 0.78 55.8<strong>1.</strong>9676262 | 1 0.78 56.59.9721107 | 1 0.78 57.36.9729731 | 1 0.78 58.14.9755679 | 1 0.78 58.9<strong>1.</strong>9756109 | 1 0.78 59.69.9756458 | 1 0.78 60.47.9770639 | 1 0.78 6<strong>1.</strong>24.9775516 | 2 <strong>1.</strong>55 62.79.9783262 | 1 0.78 63.57.9788731 | 1 0.78 64.34.9789131 | 1 0.78 65.12.981271 | 1 0.78 65.89.982046 | 1 0.78 66.67.9841557 | 2 <strong>1.</strong>55 68.22.98575 | 3 2.33 70.54.9868912 | 1 0.78 7<strong>1.</strong>32.9886874 | 1 0.78 72.09.9897027 | 1 0.78 72.87.9909082 | 1 0.78 73.64.990956 | 1 0.78 74.42.9912887 | 1 0.78 75.19.992153 | 1 0.78 75.97.9929536 | 3 2.33 78.29.9936493 | 1 0.78 79.07.9940059 | 3 2.33 8<strong>1.</strong>40.9949182 | 1 0.78 82.17.9949736 | 1 0.78 82.95.9955923 | 1 0.78 83.72.9958061 | 1 0.78 84.50.996609 | 1 0.78 85.27.9971556 | 1 0.78 86.05.9973269 | 4 3.10 89.15.9979597 | 1 0.78 89.92.9983673 | 1 0.78 90.70.9988355 | 1 0.78 9<strong>1.</strong>47.998845 | 1 0.78 92.25.9992388 | 1 0.78 93.02.9995568 | 1 0.78 93.80.9995673 | 2 <strong>1.</strong>55 95.3510.12


.999731 | 1 0.78 96.12.9997392 | 3 2.33 98.45.9999363 | 1 0.78 99.22.9999979 | 1 0.78 100.00------------+-----------------------------------Total | 129 100.00*Only a handful of cases were downweighted to less than .5.> Inspect these.;l wt male educ agewed if wt correct: a few poorly educated people <strong>married</strong> very late--after> age 30. Downweighting them allowed the general relationship> between education and age-at-first-marriage to emerge.;*E. Show this by constructing graphs. For convenience I do this> separately <strong>for</strong> males and females.;*set textsize 100;lab var educ " ";lab var xagewed " ";lab var xragewed " ";lab var agewed " ";<strong>for</strong> P in num 1 0 \ Q in num 1 2: graph twoway> (line xagewed educ, sort clwidth(medthick) clpattern(dash))> (line xragewed educ, sort clwidth(medthick) clpattern(solid))> (scatter agewed educ, jitter(2) mlcolor(black) msymbol(Oh)> mlwidth(medthick))> if race==2 & agewed>0 & agewed label(2 "Robust prediction") label(3 "Observed age"))> xlab(0(4)20)> ylab(15(5)55)> l2("Age at First Marriage")> b1("Years of Schooling")> saving(ex11_2d_Q.gph,replace);10.13


-> graph twoway (line xagewed educ, sort clwidth(medthick) clpattern(dash))> (line xragewed educ, sort clwidth(medthick) clpattern(solid)) (scatter> agewed educ, jitter(2) mlcolor(black) msymbol(Oh) mlwidth(medthick)) if race==2> & agewed>0 & agewed (3 `"Observed age"' )) xlab(0(4)20) ylab(15(5)55) l2("Age at First Marriage")> b1("Years of Schooling") saving(ex11_2d_<strong>1.</strong>gph,replace)(note: file ex11_2d_<strong>1.</strong>gph not found)(file ex11_2d_<strong>1.</strong>gph saved)-> graph twoway (line xagewed educ, sort clwidth(medthick) clpattern(dash))> (line xragewed educ, sort clwidth(medthick) clpattern(solid)) (scatter agewed> educ, jitter(2) mlcolor(black) msymbol(Oh) mlwidth(medthick)) if race==2 &> agewed>0 & agewed

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!