* NOTE: You need to set the Stata working directory to the path * where the data file is located. set more off clear quietly infix /// int year 1-4 /// float perwt 5-14 /// byte sex 15-15 /// int age 16-18 /// byte marst 19-19 /// byte marrno 20-20 /// byte marrinyr 21-21 /// int yrmarr 22-25 /// byte divinyr 26-26 /// byte race 27-27 /// byte hispan 31-31 /// byte citizen 35-35 /// byte educ 36-37 /// int educd 38-40 /// using "C:\Users\cohen\Downloads\usa_00237.dat" replace perwt = perwt / 10000 /* sample is women ages 15-59 */ keep if marst < 4 | divinyr == 2 keep if marrno==1 gen mardur = year-yrmarr gen agemar = age-mardur drop if agemar<15 egen agemarc = cut(agemar), at(15,20,25,30,35,40,45,50,60) egen agecat = cut(age), at(15,20,25,30,35,40,45,50,55,60) egen mardurc = cut(mardur), at(0,1,2,3,4,5,6,7,8,9,10,15,20,25,30,35,40,45) gen divorce = 0 replace divorce = 1 if divinyr==2 gen degree=0 replace degree=1 if educd<62 replace degree=2 if educd>=62 & educd <70 replace degree=3 if educd>=70 & educd <101 replace degree=4 if educd==101 replace degree=5 if educd>101 label define degree_lbl 1 "