*Generate weight variable**
gen wgt=v005/1000000
*Generate age, keep those <2 years
gen age=b19
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]
]]>