clear all set matsize 800 set maxvar 10000 set mem 1g cd "C:\Users\User1\Desktop\ETHIOPIA DHS 2016" use "ETIR70FL", clear set more off ** ========================================================================== ** ** WEIGHT VARIABLE gen weight = v005/1000000 gen wt=weight ** ========================================================================== ** ** SURVEY SET gen psu = v021 //gen strata = v022 gen strata = v023 svyset psu [pw = weight], strata(strata) singleunit(centered) *svydes ** ========================================================================== ** //generate variable for birth in the last two years gen birth2 =0 replace birth2=1 if b19_01<24 ** ========================================================================== ** //PNC TIMING FOR THE 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 cap drop rh_pnc_wm_timing recode pnc_wm_time (0 242/299 306/899 999 = 7 "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") (998=6 "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") /// (else = 0 "Not in 2 days"), gen(rh_pnc_wm_2days) label var rh_pnc_wm_2days "PNC check within two days for mother" ** ========================================================================== ** keep if rh_pnc_wm_timing !=. ** ========================================================================== ** ** RECODE VARIABLES FOR ANALYSIS ** * Mother’s age at birth cap drop agebirth gen agebirth=(b3_01-v011)/12 cap drop age_at_birth recode agebirth (min/19.91667=1 "<20") (20/34.91667=2 "20-34") /// (35/max=3 "35-49"), gen(age_at_birth) label var age_at_birth "Mother's age at birth" label val age_at_birth age_at_birth * Birth order gen birth_order1 = bord_01 replace birth_order1 = bord_01-1 if b0_01 == 2 replace birth_order1 = bord_01-2 if b0_01 == 3 recode birth_order1 (1=1 "1") (2/3=2 "2-3") (4/5=3 "4-5") /// (6/20=4 "6+"), gen(birth_order) label var birth_order "Birth order" label values birth_order birth_order cap drop agebirth birth_order1 ** ========================================================================== ** rename rh_pnc_wm_timing mother_PNC rename rh_pnc_wm_2days mother_PNC2dyas ** ========================================================================== ** ** CHECK ** svy: tab mother_PNC, count format(%9.0f) svy: tab mother_PNC2dyas, count format(%9.0f) svy: tab age_at_birth mother_PNC, percent format(%9.1f) row svy: tab birth_order mother_PNC, percent format(%9.1f) row svy: tab v025 mother_PNC, percent format(%9.1f) row svy: tab v024 mother_PNC, percent format(%9.1f) row svy: tab v149 mother_PNC, percent format(%9.1f) row svy: tab v190 mother_PNC, percent format(%9.1f) row * svy: tab age_at_birth mother_PNC2dyas, percent ci format(%9.1f) row svy: tab age_at_birth mother_PNC2dyas, percent format(%9.1f) row svy: tab birth_order mother_PNC2dyas, percent format(%9.1f) row svy: tab v025 mother_PNC2dyas, percent format(%9.1f) row svy: tab v024 mother_PNC2dyas, percent format(%9.1f) row svy: tab v149 mother_PNC2dyas, percent format(%9.1f) row svy: tab v190 mother_PNC2dyas, percent format(%9.1f) row ** ========================================================================== ** exit