******************************************************************* * IPUMS Education 2008 ******************************************************************* * This subfile creates education dummy variables for ACS 2008 * The file can be called whenever the data in memory contains the * variable educ. * Based on David Dorn code, updated to 'educ' , which replaced 'educ99' ******************************************************************* * Education * Note: The underlying variable differs between 1980, and 1990/2000 * The groups are defined as follows: * 1) Less than high school (lths) - up to 11th grade of high school * 2) High school (hsch) - 12th grade of high school, with or without * graduation (in 1990/2000, this category includes GEDs which cannot * be identified separately) * 3) Some college (scoll) - 1 to 3 years of college in 1980; some college * with no degree or associate degree in 1990/2000 * 4) Bachelors degree (bach) - 4+ years of college in 1980, bachelors degree * in 1990 * 5) Masters degree (master) - 6+ years of college in 1980, * masters degree/professional degree/doctoral degree in 1990/2000 ******************************************************************* foreach v in lths hsch scoll coll bach master { gen edu_`v'=0 if (educd>=2 & educd<=116) } replace edu_lths=(educd>=2 & educd<=50) replace edu_hsch=(educd>=60 & educd<=65) replace edu_scoll=(educd>=70 & educd<=90) replace edu_coll=(educd>=100 & educd<=116) replace edu_bach=(educd==100 | educd==101) replace edu_master=(educd>=110 & educd<=116) assert edu_lths + edu_hsch + edu_scoll + edu_coll == 1 if (educd>=2 & educd<=116) assert edu_bach + edu_master == edu_coll if (educd>=2 & educd<=116) gen xedu =. replace xedu =1 if edu_lths==1 replace xedu =2 if edu_hsch==1 replace xedu =3 if edu_scoll==1 replace xedu =4 if edu_coll==1 label define xedu_lbl 1 "Less than High School" 2 "High School" 3 "Some College" 4 "College" label values xedu xedu_lbl *Generate years of schooling variable gen schooling = . replace schooling = 0 if educd==2 replace schooling = 0 if educd==11 replace schooling = 0 if educd==12 replace schooling = 1 if educd==14 replace schooling = 2 if educd==15 replace schooling = 3 if educd==16 replace schooling = 4 if educd==17 replace schooling = 5 if educd==22 replace schooling = 6 if educd==23 replace schooling = 7 if educd==25 replace schooling = 8 if educd==26 replace schooling = 9 if educd==30 replace schooling = 10 if educd==40 replace schooling = 11 if educd==50 replace schooling = 11.5 if educd==61 replace schooling = 12 if educd==63 replace schooling = 12 if educd==64 replace schooling = 13 if educd==65 replace schooling = 13 if educd==71 replace schooling = 14 if educd==81 replace schooling = 16 if educd==101 replace schooling = 18 if educd==114 replace schooling = 18 if educd==115 replace schooling = 20 if educd==116