Hello,
I am trying to replicate Table 5.10 Age at first birth in 2022 KDHS report using the code below from DHS GitHub repo
use "KEIR8AFL.dta", clear
gen wt=v005/1000000
**FIRST BIRTH
//First birth by specific ages
recode v212 (.=0) (0/14 = 1 "yes") (15/49 = 0 "no"), gen (fe_afb_15)
label var fe_afb_15 "First birth by age 15"
recode v212 (.=0) (0/17 = 1 "yes") (18/49 = 0 "no"), gen (fe_afb_18)
replace fe_afb_18 = . if v012<18
label var fe_afb_18 "First birth by age 18"
recode v212 (.=0) (0/19 = 1 "yes") (20/49 = 0 "no"), gen (fe_afb_20)
replace fe_afb_20 = . if v012<20
label var fe_afb_20 "First birth by age 20"
recode v212 (.=0) (0/21 = 1 "yes") (22/49 = 0 "no"), gen (fe_afb_22)
replace fe_afb_22 = . if v012<22
label var fe_afb_22 "First birth by age 22"
recode v212 (.=0) (0/24 = 1 "yes") (25/49 = 0 "no"), gen (fe_afb_25)
replace fe_afb_25 = . if v012<25
label var fe_afb_25 "First birth by age 25"
//Never had a first birth
gen fe_birth_never = 0
replace fe_birth_never = 1 if v201==0
label val fe_birth_never yesnolabel
label var fe_birth_never "Never had a birth"
tabstat fe_afb_15 fe_afb_18 fe_afb_20 fe_afb_22 fe_afb_25 fe_birth_never [fw=v005], statistics(mean) save
but for some reason the results aren't matching. I will appreciate any help. Thanks in advance!