The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Nutrition and Anthropometry » Calculating for children less than 23 months
Calculating for children less than 23 months Sun, 28 February 2016 16:57
 tony Messages: 10Registered: March 2013 Location: Ghana Member
Daer all,

I'm trying to calculate for the number of youngest child under two years living with their mother. But the figures I get do not correspond with those in the report; thus Table 11.3: Breastfeeding status by age. I am using the children file of Ghana DHS 2014. Any help. Thanks.

Below is the Stata code I used.

clear
keep if midx==1&b9==0&hw1<24
tab hw1
recode hw1(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 child_age
tab child_age[w=v005]
Re: Calculating for children less than 23 months [message #9295 is a reply to message #9260] Sat, 05 March 2016 01:36
 Trevor-DHS Messages: 795Registered: January 2013 Senior Member
Here is code for selecting the children to include. Two important differences with your code:
1) hw1 is not available for all children in this survey, I believe because anthropometry was collected in a subsample of households. It is generally better to calculate age in months using v008-b3.
2) The youngest child under age 2 living with the mother is not always the child with midx=1 (the last child born). It can be that the last child born either died or does not live with the monther, but the next to last child fits the criteria.

```use "C:\Data\DHS_Stata\GHKR70FL.DTA", clear
gen age = v008-b3

* select on the living children under 2
keep if age<24 & b5==1

* regroup age
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")(24/59=.), gen(child_age)

* tabulate for the last column in table 11.3
tab child_age
tab child_age[iw=v005/1000000]

* Now restrict further
* Keep only those living with their mother
keep if b9==0
* and now check if it is the youngest
* children are in order with youngest first, any other child with the same caseid is not the youngest
drop if _n > 0 & caseid == caseid[_n-1]

* tabulate for the number of youngest children under age 2 living with mother
tab child_age
tab child_age[iw=v005/1000000]```
Re: Calculating for children less than 23 months [message #9307 is a reply to message #9295] Tue, 08 March 2016 09:01
 tony Messages: 10Registered: March 2013 Location: Ghana Member
Thank you Trevor.
Re: Calculating for children less than 23 months [message #9369 is a reply to message #9295] Mon, 21 March 2016 07:13
 tony Messages: 10Registered: March 2013 Location: Ghana Member
Dear Trevor,

Please, from the previous response (on calculating child age), I tried to get exclusively breastfed children but my figures were different from the report. Any help on what I did not do right?

Thus after running the commands for children ages (0-23m), I followed that with:

*The number of times the children received anything to eat
///aside from breast milk, including both meals and snacks///
//Children who are being exclusively breastfed are coded 0
tab m39

*Recoding m39 to get exclusively breastfed and not exclusively breastfed
recode m39(0=0 "excl")(1/8=1 "no_excl"), gen(excl_brst)
tab excl_brst