The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Nutrition and Anthropometry » INFANT AND YOUNG CHILD FEEDING PRACTICE
INFANT AND YOUNG CHILD FEEDING PRACTICE [message #15369] Sun, 08 July 2018 20:28 Go to next message
phehintee@gmail.com is currently offline  phehintee@gmail.com
Messages: 4
Registered: July 2018
Member
Dear,
I am working on the IYCF indicators for India, however, my results have not been correlating with the NFHS 2015/2016 report. Below are my stata code, kindly help me check for where I am getting it wrong. Most especially in my minimum meal frequency.

/* Renaming variables */
rename v130 religion
rename v106 educ
rename v024 state
rename v013 m_agegrp5
rename v012 m_age
rename b4 sex
rename v717 occupation
rename m14 antenatal_no
rename s190u urban_wealth_index
rename v190 wealth_index

/* drop if too old or not alive*/
keep if age_months<24 & b5==1
* recode age into groups
recode age_months (0/1=1 "0-1")(2/3=2 "2-3")(4/5=3 "4-5")(6/8=4 "6-8")(9/11=5 "9-11") ///
(12/17=6 "12-17")(18/23=7 "18-23")(24/59=.), gen(child_age)
* tab of all living children born in the last 2 years
tab child_age
tab child_age [iw=v005/1000000]
*living with mother
keep if b9==0
* ... and keep the last born of those
drop if _n > 0 & caseid == caseid[_n-1]
* check the deonimnator
tab child_age
tab child_age [iw=v005/1000000]


*Early initiation of breastfeeding*
recode m34 999=.
gen ebf=.
replace ebf=1 if m34 ==0 | m34==100
replace ebf=0 if m34 >=101 & m34!=.
label define ebf 1"yes" 0"no"
label values ebf ebf
tab ebf
tab resident ebf [iw=v005/1000000],row

/*Exclusive breastfeeding*/
/*Breastfeeding Status*/
gen stillbrtfeeding=0
replace stillbrtfeeding = 1 if m4 ==95
replace stillbrtfeeding = 2 if m4 ==94
label define stillbrtfeeding 1 "still breastfeeding" 2 "never breastfed"
label values stillbrtfeeding stillbrtfeeding


/*coding other food given*/
gen water=0
gen liquids=0
gen milk=0
gen solids=0
gen breast=0

replace water=1 if (v409>=1 & v409<=7)
. replace liquid=1 if (v410>=1 & v410<=7)
. replace liquid=1 if (v413>=1 & v413<=7)
replace liquid=1 if (v412>=1 & v412<=7)
replace solids =1 if (v414a>=1 & v414a<=7)
replace solids =1 if (v414e>=1 & v414e<=7)
replace solids =1 if (v414f>=1 & v414f<=7)
replace solids =1 if (v414g>=1 & v414g<=7)
replace solids =1 if (v414h>=1 & v414h<=7)
replace solids =1 if (v414i>=1 & v414i<=7)
replace solids =1 if (v414j>=1 & v414j<=7)
replace solids =1 if (v414k>=1 & v414k<=7)
replace solids =1 if (v414l>=1 & v414l<=7)
replace solids =1 if(v414m>=1 & v414m<=7)
replace solids =1 if (v414n>=1 & v414n<=7)
replace solids =1 if (v414o>=1 & v414o<=7)
replace solids =1 if (v414p>=1 & v414p<=7)
replace solids =1 if(v414s>=1 & v414s<=7)
replace solids =1 if (v414t>=1 & v414t<=7)
replace solids =1 if (v414v>=1 & v414v<=7)


*Still breastfeeding
replace breast=1 if m4==95

* Generate column variable used in table 11.3
gen feeding=1
replace feeding=2 if water==1
replace feeding=3 if liquids==1
replace feeding=4 if milk==1
replace feeding=5 if solids==1
replace feeding=0 if breast==0
tab feeding,m

label define feeding 0 "Not breastfeeding" 1 "exclusive breastfeeding" 2 "+Water" 3 "+Liquids" 4 "+Other Milk" 5 "+Solids"
label values feeding feeding

tab child_age feeding
tab child_age feeding [iweight=v005/1000000] if child_age <= 3, row

*Continued Breastfeeding at 1 year by Residence*/
gen cbf=0
replace cbf = 1 if breast ==1
label define cbflabel 0 "not-continued bfeeding" 1 "continued bfeeding"
label values cbf cbflabel
tab cbf [iweight=v005/1000000] if if age_months>=12 & age_months<=15,row


/*Introduction of solid, semi-solid or soft foods by residence*/
recode m39 999=., gen (complemen_intro)
replace complemen_intro=1 if m39>=1 & m39<8
replace complemen_intro=. if m39==8
replace complemen_intro=0 if m39==0
label define complemen_introlabel 1 "introduced" 0 "not-introduced"
label values complemen_intro complemen_introlabel
tab complemen_intro [iweight=v005/1000000] if if age_months>=6 & age_months<=8,row

/*Counts Minimum meal frequency*/
recode m39 (2/7=1 "2-7")(else=0), gen(mm1)
recode m39 (3/7=1 "3-7")(else=0), gen(mm2)
recode m39 (4/7=1 "4-7")(else=0), gen(mm3)


/*minimum meal frequency 6-8 months breastfed*/
gen byte mmf1=.
replace mmf1=1 if mm1==1 & breast ==1 & child_age==4
replace mmf1=0 if mm1==0 & breast ==1& child_age==4
label define mmf1 0 "Not Freq" 1 "Freq"
label values mmf1 mmf1


/*minimum meal frequency 9-23 months breastfed*/
gen byte mmf2=.
replace mmf2=1 if mm2==1 & breast ==1 & age_months>=9 & age_months<=23
replace mmf2=0 if mm2==0 & breast ==1 & age_months>=9 & age_months<=23
label define mmf2 0 "Not Freq" 1 "Freq"
label values mmf2 mmf2


/*minimum meal frequency 6-23 months breastfed*/
gen byte mmf=.
replace mmf=1 if mmf1==1|mmf2==1
replace mmf=0 if mmf1==0 | mmf2==0
label define mmf 0 "Not Freq" 1 "Freq"
label values mmf mmf
tab mmf [iweight=v005/1000000]


/*minimum meal frequency 6-23 months non-breastfed*/
gen ptfmilk=1 if (v469e>=1 & v469e<=7)
label value ptfmilk ptfmilk
label variable ptfmilk "ptfmilk"

gen formula=1 if (v469f>=1 & v469f<=7)
label value formula formula
label variable formula "formula"

gen yogurt=1 if (v469x>=1 & v469x<=7)
label value yogurt yogurt
label variable yogurt "yogurt"

egen nonbrstfd = rsum(ptfmilk formula yogurt mm3) if ptfmilk~=.| formula~=.| yogurt~=.| mm3~=.
label variable nonbrstfd "non-breastfed meal frequency"

recode nonbrstfd (1/3 .=0 "No") (4/7=1 "Yes"), gen(meal4)
tab meal4 [iw=v005/1000000]

gen totmilk=0
replace totmilk =1 if (v469e>=1 & v469e<=7)
replace totmilk =1 if (v469f>=1 & v469f<=7)
replace totmilk =1 if (v469x>=1 & v469x<=7)

replace breast=2 if m4==94
gen nbfeeding= totmilk
replace nbfeeding=1 if

/*sum minimum meal frequencey for breastfed and non-breastfed*/
gen smmf=.
replace smmf=1 if totalnbmmf==1|mmf==1
replace smmf=0 if totalnbmmf==0|mmf1==0
label define smmf 0 "Not Freq" 1 "Freq"
label values smmf smmf
tab smmf [iw=v005/1000000], row


/*minimum diet diversity*/
gen grains=1 if v412a==1| v414e==1|v414f==1
label value grains grains
label variable grains "grains, roots and tuber"
tab grains

gen legumes=1 if v414o==1
label value legumes legumes
label variable legumes "legumes and nuts"

gen dairyp=1 if v411==1 | v411a==1 | v414p==1 |v414v==1
label value dairyp dairyp
label variable dairyp "dairy products"


gen fleshf=1 if v414h==1 | v414m==1 | v414n==1
label value fleshf fleshf
label variable fleshf "fleshy food"

gen eggs=1 if v414g==1
label value eggs eggs
label variable eggs "eggs"

gen vitama=1 if v414i==1|v414j==1|v414k==1
label value vitama vitama
label variable vitama "vitamin_a"

gen ofruits=1 if v414l==1
label value ofruits ofruits
label variable ofruits "others fruits"

egen dietindC = rsum(grains legumes dairyp fleshf vitama ofruits eggs) if grains~=.| legumes~=.| dairyp~=.| fleshf~=.| vitama~=.| ofruits~=.| eggs~=.
label variable dietindC "minimum dietary diversity children"

recode dietindC (1/3 .=0 "No") (4/7=1 "Yes"), gen(diet4)
ta diet4 [iw=v005/1000000]


/*minimum dietary diversity 6-23 months*/
tab diet4 [iweight=v005/1000000] if age_months>=6 & age_months<=23,chi col

/*minimum acceptable diet*/
/* breastfed minimum aceptable diet*/
gen byte bfminadt=.
replace bfminadt=1 if diet4==1 & mmf==1 & age_months>=6 & age_months<=23
replace bfminadt=0 if diet4==0 & mmf==0 & age_months>=6 & age_months<=23 & still_feeding==1
tab bfminadt [iw=v005/1000000],row


/* non-breastfed minimum aceptable diet(nbmad)*/
/*dietary diversity for non-breastfed for assessing minimum aceptable diet*/
egen dietindCmad = rsum(grains legumes fleshf vitama ofruits eggs) if grains~=.| legumes~=.|fleshf~=.| vitama~=.| ofruits~=.| eggs~=.
label variable dietindC "minimum dietary diversity mad"
recode dietindCmad (1/3 .=0 "No") (4/6=1 "Yes"), gen(mad4)

/*Milk food*/
gen milkpowder=1 if v469e>=2
gen infantformular=1 if v469f>=2
gen yogurt_milk=1 if v469x>=2
gen milkfeeds=1 if milkpowder==1 | yogurt_milk==1 |infantformular==1

gen nbmad=0
replace nbmad=1 if milkfeeds==1 & dietindCmad==1 & breast==2 & mm3==1 & age_months>=6 & age_months<=23
replace nbmad=1 if milkfeeds==1 & dietindCmad==1 & breast==2 & mm3==1 & age_months>=6 & age_months<=23
label var nbmad "not freq vs freq"
label values nbmad nbmadlabel
label define nbmadlabel 0 "no-met" 1 "met"
tab nbmad [iweight=v005/1000000], col


/*minimum acceptable diet for both breastfed and non-breastfed*/
gen byte totalmad=.
replace totalmad=1 if nbmad==1 | bfminadt==1
replace totalmad=0 if nbmad==0 | bfminadt==0
tab totalmad [iweight=v005/1000000] , col

I look forward to your kind response



Re: INFANT AND YOUNG CHILD FEEDING PRACTICE [message #15458 is a reply to message #15369] Tue, 24 July 2018 10:43 Go to previous messageGo to next message
Liz-DHS
Messages: 1516
Registered: February 2013
Senior Member
A response from one of our analysts, Rukundo Benedict:
Quote:

Dear User,
The code below will match the report. Your code was mostly correct, just a few errors. Always make sure to select the correct sample to match the report and check the variables for the combined food groups since these can differ slightly by country (e.g. the flesh foods was missing v414a v414t).
*Early Initiation of Breastfeeding*

*Generate weight variable**

gen wgt=v005/1000000

* keep only children less than 2 years 
gen age = v008-b3
keep if age<24
* keep last born children
keep if bidx==1
ta age [iw=wgt]

*Ever breastfed
gen everbf=.
replace everbf=1 if m4==93| m4==95
replace everbf=0 if m4==94
ta everbf [iw=wgt]

*EBF by age {note the sample is slightly different}*

*Generate weight variable**
gen wgt=v005/1000000

*Generate age, keep those <2 years
gen age = v008-b3
keep if age<24
*keep only those children alive 
ta b5
keep if b5==1

*Generate age groups
recode age (0/1=1 "0-1")(2/3=2 "2-3")(4/5=3 "4-5")(6/8=4 "6-8")(9/11=5 "9-11")(12/17=6 "12-17")(18/23=7 "18-23"), gen (age_months)

*Important Note: children must be the youngest child and living with mother
*keep only those living with mother
keep if b9==0
* finding the youngest child living with the mother
bysort v001 v002 v003: egen minbidx=min(bidx) 
* keep only children less than 2 years 
keep if age<24
ta bidx minbidx 
* need to drop those that are bidx==2 and minbidx==1
drop if bidx>minbidx
ta age_month [iw=wgt]


gen water=0
gen liquids=0
gen milk=0
gen solids=0
gen breast=0


*To determine if child is given water, sugar water, juice, tea or other  
replace water=1 if (v409>=1 & v409<=7)
                  
* If given other liquids
foreach xvar of varlist v409a v410 v410a v413*  {
replace liquids=1 if `xvar'>=1 & `xvar'<=7
}
                                                                                          
* If given powder/tinned milk, formula or fresh milk 
foreach xvar of varlist v411 v411a v412 v414p {
replace milk=1 if `xvar'>=1 & `xvar'<=7
}

*If currently breastfeeding
replace breast=1 if m4==95 


*If given any solid
foreach xvar of varlist v414* {
replace solids=1 if `xvar'>=1 & `xvar'<=7
}
replace solids=1 if v412a==1 | v412b==1 

gen feeding=1
replace feeding=2 if water==1
replace feeding=3 if liquids==1
replace feeding=4 if milk==1
replace feeding=5 if solids==1
replace feeding=0 if breast==0
label define feeding 0 "Not breastfeeding" 1 "exclusive breastfeeding" 2 "+Water" 3 "+Liquids" 4 "+Other Milk" 5 "+Solids"
label val feeding feeding


ta age_month feeding  [iw=wgt], row
ta age_month breast  [iw=wgt], row





*MMD MMF MAD*


*Generate weight variable**
gen wgt=v005/1000000

*Generate age, keep those <2 years
gen age = v008-b3
keep if age<24
*keep only those children alive 
ta b5
keep if b5==1
*children must be the youngest child and living with mother
*keep only those living with mother
keep if b9==0
* finding the youngest child living with the mother
bysort v001 v002 v003: egen minbidx=min(bidx) 
* keep only children less than 2 years 
keep if age<24
ta bidx minbidx 
* need to drop those that are bidx==2 and minbidx==1
drop if bidx>minbidx

*drop those under 6 months
drop if age<6

*Generate age groups
recode age (6/8=1 "6-8")(9/11=2 "9-11")(12/17=3 "12-17")(18/23=4 "18-23"), gen (age_months)
ta age_month [iw=wgt]



gen dairy=0
gen grains=0
gen VitA_vegfru=0
gen o_vegfru=0
gen eggs=0
gen tuber_roots=0
gen meats=0
gen legumes=0
gen breast=0

*If currently breastfeeding
replace breast=1 if m4==95 
label var breast "Currently breastfeeding"

* If given dairy
foreach xvar of varlist v411 v411a v414v v414p {
replace dairy=1 if `xvar'>=1 & `xvar'<=7
}     
label variable dairy "Dairy products"
                                             
* If given grains, roots, tubers
foreach xvar of varlist v412a v414e v414f {
replace grains=1 if `xvar'>=1 & `xvar'<=7
} 
label var grains "Grains, Roots, Tubers" 

* If given vit A fruits and veg
foreach xvar of varlist v414i v414j v414k {
replace VitA_vegfru=1 if `xvar'>=1 & `xvar'<=7
} 
label var VitA_vegfru "Vit A rich veg & fruits"

* If given other fruits and veg 
replace o_vegfru=1 if (v414l>=1 & v414l<=7) 
label var o_vegfru "Other veg & fruits"

* If given eggs
replace eggs=1 if (v414g>=1 & v414g<=7) 
label var eggs "Eggs"

* If given meats
foreach xvar of varlist v414a v414m v414n v414t {
replace meats=1 if `xvar'>=1 & `xvar'<=7
}  
label var meats "Meats"

* If given legumes_ nuts
replace legumes=1 if (v414o>=1 & v414o<=7)
label var legumes "legumes & nuts"


*Creating food groups 
gen allgroups= dairy + grains + VitA_vegfru + o_vegfru + eggs + meats + legumes
gen allgroups1= grains + VitA_vegfru + o_vegfru + eggs + meats + legumes


*Generate total milk foods
gen totmilkf=0
replace totmilkf=v469e if (v469e>0 & v469e<=7)
replace totmilkf=v469f if (v469f>0 & v469f<=7)
replace totmilkf=v469x if (v469x>0 & v469x<=7)
label var totmilkf "Total milk foods"


*feeding frequency for **Breastfeed** child age 6-8 months, 9-23 months  
gen minfeed=0
replace minfeed=1 if breast==1 & age_months==1 & (m39>=2 & m39<=7)
replace minfeed=1 if breast==1 & (age_months==2| age_months==3 |age_months==4) & (m39>=3 & m39<=7)

*feeding frequency for **Non-breastfeed** child age 6-23 months
gen feedings=totmilkf
replace feedings= feedings + m39 if (m39>0 & m39<=7)
replace minfeed=1 if breast==0 & feedings>=4 
 
 
*Generating MDD, MMF, MAD vars
gen MDD=0
replace MDD=1 if  breast==1 & allgroups>=4 
replace MDD=1 if  breast==0 & allgroups>=4 
label var MDD "Minimum diet diversity children"

gen MMF=0
replace MMF=1 if breast==1 & minfeed==1
replace MMF=1 if breast==0 & minfeed==1
label var MMF "Minimum meal frequency children"

gen MAD=0
replace MAD=1 if breast==1 & allgroups>=4 & minfeed==1
replace MAD=1 if breast==0 & allgroups1>=4 & minfeed==1 & totmilkf>=2
label var MAD "Minimum acceptable diet children"

gen milkp=0
replace milkp=1 if breast==1| totmilkf>=2
label var milkp "Milk/Milk products"


*Tabulation
local iycf "MDD MMF MAD milkp"
foreach xvar of varlist `iycf'{
ta age_months `xvar' if breast==1 [iw=wgt], row
ta age_months `xvar' if breast==0 [iw=wgt], row
ta age_months `xvar' [iw=wgt], row
}

clear 

Re: INFANT AND YOUNG CHILD FEEDING PRACTICE [message #15475 is a reply to message #15458] Sat, 28 July 2018 17:10 Go to previous messageGo to next message
phehintee@yahoo.com is currently offline  phehintee@yahoo.com
Messages: 2
Registered: July 2018
Member
Thank you for your reponse
Re: INFANT AND YOUNG CHILD FEEDING PRACTICE [message #16234 is a reply to message #15458] Fri, 30 November 2018 05:42 Go to previous message
radhs
Messages: 4
Registered: November 2018
Member
Dear Mam,
MMF mentioned in code is not matching report status. It is 35.9 in report but as per code it is showing 34.86 overall.Though statistics for MDD is matching the report.
Previous Topic: Append datasets about breastfeeding indicators
Next Topic: Correct stunting rate but wrong number of PSUs
Goto Forum:
  


Current Time: Tue Apr 16 13:45:57 Coordinated Universal Time 2024