* PROGRAM: edudate2.do
* DATE: November 12, 1998
* This program generates education variables from the schooling variables in the CPS
* Note that beginning in 1991, the CPS categorizes educational attainment differently
* than in previous years. This program attempts to make variables consistent across
* years
program define educate2
if ${year}<=86 {
* Years of schooling
* Recode grdhi (highest grade attended) so that 12th grade equals 12 and
* kindgergarten equals 0 for the years prior to 1987 (grdhi for 1988-1991
* is coded this way).
gen edu=grdhi-1 if grdhi>=1
* Subtract one year if the highest grade attended is not completed (grdcom==2)
replace edu=edu-1 if grdcom==2 & edu>=1
}
if ${year}>=87 & ${year}<=90 {
* Years of schooling
gen edu=grdhi
* Subtract one year if the highest grade attended is not completed (grdcom==2)
replace edu=edu-1 if grdcom==2 & edu>=1
}
label variable edu "Years of Education"
end