The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in SPSS » Calculating cases for IYCF
Re: Calculating cases for IYCF [message #11100 is a reply to message #11097] Wed, 26 October 2016 18:12 Go to previous messageGo to previous message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 787
Registered: January 2013
Senior Member
This is a common misunderstanding. The youngest child living with the mother is not necessarily one with BIDX = 1. BIDX = 1 is for the last child born, but if the last child born had died or does not live with the mother, then the youngest child living with the mother may have BIDX = 2.

Try the following code:
* Cases should be sorted already, but in case they are not
sort caseid bidx
* Last child in the last 2 years living with mother
* age in months
gen age = v008-b3
lab var age "Age in months"
* keep if under 24 months and living with mother
keep if age<24 & b9==0
* ... and keep the last born of those. If caseid is the same as the prior case, then not the last born.
drop if _n > 0 & caseid == caseid[_n-1]
* generate variable for still breastfeeding
recode m4 (95=1 "Still breastfeeding")(else=0 "Not breastfeeding"), gen(bf)
lab var bf "Currently breastfeeding"
* generate age groupings
recode age (0/5 = 0 "0-5")(6/8 = 1 "6-8")(9/11 = 2 "9-11")(12/17 = 3 "12-17")(18/23 = 4 "18-23"), gen(ageg)
lab var ageg "Age groups"

* tabulate current breastfeeding status by age group
tab ageg bf [iw=v005/1000000]


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Selecting one child per mother
Next Topic: Postnatal care utilization variable in 2015-2016 MDHS dataset
Goto Forum:
  


Current Time: Tue Mar 19 06:27:10 Coordinated Universal Time 2024