The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Kenya » KDHS 2022: Table 11.4 Breastfeeding status according to age
Re: KDHS 2022: Table 11.4 Breastfeeding status according to age [message #28247 is a reply to message #28244] Tue, 05 December 2023 11:49 Go to previous messageGo to previous message
sokiya is currently offline  sokiya
Messages: 79
Registered: May 2017
Location: Nairobi
Senior Member
Thanks so much for the guidance. I sincerely appreciate.
I have replaced age with b19 as per the code below but I still can't replicate the results
use "${gsdDataRaw}/2022/DHS/KEKR8AFL.dta", clear

*** Breastfeeding and complemenatry feeding ***

//currently breastfed
gen nt_bf_curr= m4==95
label values nt_bf_curr yesno
label var nt_bf_curr "Currently breastfeeding - last-born under 2 years"

//breastfeeding status
	gen water=0
	gen liquids=0
	gen milk=0
	gen solids=0

	*Child is given water
	replace water=1 if (v409>=1 & v409<=7)
		   
	*Child given liquids
	foreach xvar of varlist v409a v410 v410a v412c v413* {
		replace liquids=1 if `xvar'>=1 & `xvar'<=7
	}

	*Given powder/tinned milk, formula, or fresh milk
	foreach xvar of varlist v411 v411a {
		replace milk=1 if `xvar'>=1 & `xvar'<=7
	}

	*Given any solid food
	foreach xvar of varlist v414* {
		replace solids=1 if `xvar'>=1 & `xvar'<=7
	}
	replace solids=1 if v412a==1 | v412b==1 | m39a==1
	gen nt_bf_status=1
	replace nt_bf_status=2 if water==1
	replace nt_bf_status=3 if liquids==1
	replace nt_bf_status=4 if milk==1
	replace nt_bf_status=5 if solids==1
	replace nt_bf_status=0 if nt_bf_curr==0
	label define bf_status 0"not bf" 1"exclusively bf" 2"bf & plain water" 3"bf & non-milk liquids" 4"bf & other milk" 5"bf & complemenatry foods"
	label values nt_bf_status bf_status
	label var nt_bf_status "Breastfeeding status for last-born child under 2 years"

//exclusively breastfed
recode nt_bf_status (1=1) (else=0) if b19<6, gen(nt_ebf)
label values nt_ebf yesno
label var nt_ebf "Exclusively breastfed - last-born under 6 months"

ta nt_ebf [iw=v005] if b9==0
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: KDHS 2022 - Current use of contraception
Next Topic: KDHS 2022: Table 2.17 Food security status
Goto Forum:
  


Current Time: Sat Nov 30 18:20:43 Coordinated Universal Time 2024