clear all set matsize 800 set maxvar 10000 set mem 1g cd "C:\Users\User1\Desktop\ETHIOPIA DHS 2016" use "ETKR70FL", 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) ** ========================================================================== ** keep if midx == 1 & b19 < 24 gen birth2 =0 replace birth2=1 if b19<24 ** ========================================================================== ** //PNC TIMING FOR THE BABY gen babycheck=0 if birth2 ==1 replace babycheck = 1 if (m70==1 | m74==1) & birth2==1 cap drop pnc_baby_time gen pnc_baby_time = 999 if (birth2==1 & babycheck ==1) replace pnc_baby_time = m75 if inrange(m76,11,29) & birth2==1 replace pnc_baby_time = m71 if pnc_baby_time == 999 & inrange(m72,11,29) & birth2==1 replace pnc_baby_time = 0 if babycheck == 0 & birth2 ==1 cap drop baby_PNC recode pnc_baby_time (100 =1 "<1 hour") (100/103=2 "1-3 hours") /// (104/123 = 3 "4 to 23 hours") (124/171 201/202 = 4 "1-2 days") /// (172/197 203/206 =5 "3-6 days") (207/241 300/305 = 6 "7-41 days") /// (998 =7 "Don't know") (else = 8 "No postnatal check") if birth2==1, gen(baby_PNC) label var baby_PNC "Timing of first postnatal check for the newborn" label val baby_PNC baby_PNC cap drop PNC_baby gen PNC_baby=baby_PNC replace PNC_baby = 8 if baby_PNC==6 label define PNC_baby 1"<1 hour" 2"1-3 hours" 3"4-23 hours" 4"1-2 days" /// 5"3-6 days" 7"Don't know" 8"No postnatal check" label var PNC_baby "Timing of first postnatal check for the newborn" label val PNC_baby PNC_baby ** ========================================================================== ** //PNC within 2days for mother recode PNC_baby (1/4 =1 "Within 2 days") /// (else = 0 "Not in 2 days"), gen(baby_PNC_2days) label var baby_PNC_2days "Percentage of births with a postnatal check during the first 2 days after birth" ** ========================================================================== ** keep if PNC_baby !=. ** ========================================================================== ** ** RECODE VARIABLES FOR ANALYSIS ** * Mother’s age at birth cap drop agebirth gen agebirth=(b3-v011)/12 *tab agebirth 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 replace birth_order1 = bord-1 if b0 == 2 replace birth_order1 = bord-2 if b0 == 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 ** ========================================================================== ** ** CHECK ** svy: tab age_at_birth baby_PNC_2days, percent format(%9.1f) row miss svy: tab birth_order baby_PNC_2days, percent format(%9.1f) row miss svy: tab v190 baby_PNC_2days, percent format(%9.1f) row miss svy: tab age_at_birth PNC_baby, percent format(%9.1f) row miss svy: tab birth_order PNC_baby, percent format(%9.1f) row miss svy: tab v190 PNC_baby, percent format(%9.1f) row miss exit