The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Kenya » KDHS 2022: Table 5.10 Age at first birth
KDHS 2022: Table 5.10 Age at first birth [message #28340] Sat, 16 December 2023 09:53 Go to previous message
sokiya is currently offline  sokiya
Messages: 78
Registered: May 2017
Location: Nairobi
Senior Member
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!
 
Read Message
Read Message
Read Message
Previous Topic: KDHS 2022 : Table 11.13.1 Nutritional status of women age 2049
Next Topic: Merging IR and MR Kenya 2022 (2022 KDHS)
Goto Forum:
  


Current Time: Tue Nov 26 23:00:05 Coordinated Universal Time 2024