use MWIR7HFL.dta, clear gen wt = v005/1e6 ***************************** //generate variable for birth in the last two years gen birth2 =0 replace birth2=1 if b19_01<24 ***************************** //PNC timing for mother gen momcheck=0 if birth2 ==1 replace momcheck =1 if (m62_1 ==1 |m66_1==1) & birth2==1 gen pnc_wm_time = 999 if (birth2==1 & momcheck ==1) replace pnc_wm_time = m63_1 if inrange(m64_1, 11,29) & birth2 ==1 replace pnc_wm_time = m67_1 if pnc_wm_time == 999 & inrange(m68_1, 11,29) & birth2 ==1 replace pnc_wm_time = 0 if momcheck == 0 & birth2 ==1 recode pnc_wm_time (0 242/299 306/899 = 0 "No check or past 41 days") ( 100/103 =1 "less than 4 hours") (104/123 200 = 2 "4 to 23 hours") (124/171 201/202 = 3 "1-2 days") /// (172/197 203/206 =4 "3-6 days") (207/241 300/305 = 5 "7-41 days") (else =9 "Don't know or missing") if birth2==1 , gen(rh_pnc_wm_timing) label var rh_pnc_wm_timing "Timing after delivery for mother's PNC check" ***************************** //PNC within 2days for mother recode rh_pnc_wm_timing (1/3 =1 "Within 2 days") (0 4 5 9 = 0 "Not in 2 days"), gen(rh_pnc_wm_2days) label var rh_pnc_wm_2days "PNC check within two days for mother"