* do e:\DHS\Breastfeeding\Kenya2022_breastfeeding_do_8Dec2023.txt * Program to construct the IYCF (breastfeeding) indicator in tables 11.4 and 11.5 * Applied to Kenya 2022 survey * The n should be 888; this program gives 885. Cannot explain the difference. * This is a modification of the approach in the GitHub program * Except for the slight difference in n, this matches table 11.5 * Open the KR file use "C:\Users\26216\ICF\Analysis - Shared Resources\Data\DHSdata\KEKR8BFL.DTA" , clear * We want the youngest child living with the mother egen bidxr=rank(bidx) if b9==0 & b19<6, by(v001 v002 v003) tab bidx bidxr gen breast=0 replace breast=1 if m4==95 replace breast=. if bidxr==. replace breast=. if v409==. * Types of infant and young child feeding * Note that m38 (bottle feeding) is not counted as Other Milk; it goes not contribute * to the construction of diet gen bottle=0 replace bottle=1 if m38==1 * New approach with locals that makes it easier to match the variables to the types local ltypes water liquids milk * Asterisks are not allowed in the following locals * Some of the variables are NA in specific surveys; must review for each survey * Note different classifications of yogurt; yogurt as a drink is milk * No drink counts as milk if it has sugar * For water, liquids, and milk, construct locals with the variable names local lwater v409 local lliquids v410 v410a v410as v411s v412c v413 v413as v413s v413b v413c v413d local lmilk v411 v411a v413a foreach lt of local ltypes { gen `lt'=0 if breast<. foreach ll of local l`lt' { replace `lt'=1 if `ll'==1 } } * For solids, construct a local for the letters of v414. Ok to include NA variables * so long as they are actually in the data gen solids=0 if breast<. local lsolids a b c d e f g h i j k l m n o p q r s t u v w wa foreach ll of local lsolids { replace solids=1 if v414`ll'==1 } gen diet=. replace diet=0 if breast==1 & water==0 & liquids==0 & milk==0 & solids==0 replace diet=1 if breast==1 & water==1 & liquids==0 & milk==0 & solids==0 replace diet=2 if breast==1 & liquids==1 & milk==0 & solids==0 replace diet=3 if breast==1 & milk==1 & solids==0 replace diet=4 if breast==1 & milk==0 & solids==1 replace diet=5 if breast==1 & milk==1 & solids==1 replace diet=6 if breast==0 tab diet,m label define diet 0 "Breastfed Only" /// 1 "Breastmilk and Water" /// 2 "Breastmilk and Liquids" /// 3 "Breastmilk and Other Milk" /// 4 "Breastmilk and Solids" /// 5 "Breastmilk, Milk and Solids" /// 6 "Weaned" /// 8 "Don't know" label values diet diet * diet is DK if any component is DK * In Kenya 2022 there is another special code that ranks above .; ignore it foreach lt of local ltypes { foreach ll of local l`lt' { replace diet=8 if `ll'==8 } } foreach ll of local lsolids { replace diet=8 if v414`ll'==8 } replace diet=. if bidxr~=1 * The following matches Table 11.5 tab diet [iw=v005/1000000] * To get the indicator for the first 3 columns of table 11.4: * For table 11.4, the construction of "Mixed milk feeding" is survey-specific * Here, dietr is just a collapse of diet. gen dietr=diet replace dietr=1 if diet>=1 & diet<=5 label define dietr 0 "Exclusive breastfeeting" 1 "Breast milk and other" 6 "Weaned" 8 "Don't know" label values dietr dietr tab dietr [iw=v005/1000000]