The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Nutrition and Anthropometry » replicating children 6-23 month
replicating children 6-23 month [message #14957] Mon, 21 May 2018 09:16 Go to next message
Riri is currently offline  Riri
Messages: 1
Registered: May 2018
Location: Ethiopia
Member
Dear

I am using the Ethiopian 2016 DHS and I couldnt match the table 11.8 "among youngest children age 6-23 months living with the mother". The total number in the table includes 2960 children while I am getting 3075 after applying the following command in stata.

use "C:\Users\UserPc\Desktop\thesis\stata 2016\diet diet.dta" , clear
gen age = v008-b3

* select on the living children 6-23 month
keep if age<24 &age>5 & b5==1

* regroup age
recode age(0/5=.)(6/8=1 "6-8")(9/11=2 "9-11")(12/17=3 "12-17")(18/23=4 "18-23")(24/59=.), gen(child_age)


tab child_age
tab child_age[iw=v005/1000000]

* Keep only those living with their mother
keep if b9==0

* for checking if the child is the youngest
drop if _n > 0 & caseid == caseid[_n-1]

tab child_age
tab child_age[iw=v005/1000000]

Can you please explain to me how I can get the exact number and percentage as the table in the report.
Thank you
Re: replicating children 6-23 month [message #15005 is a reply to message #14957] Thu, 24 May 2018 16:47 Go to previous messageGo to next message
Liz-DHS
Messages: 1516
Registered: February 2013
Senior Member
Dear User,
Please take a look at this post by Trevor Croft: https://www.dhsprogram.com/data/calculating-the-age-of-children.cfm
If you still need assistance please post again.
Thank you!
Re: replicating children 6-23 month [message #15470 is a reply to message #15005] Thu, 26 July 2018 23:56 Go to previous message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 805
Registered: January 2013
Senior Member
Try the following:
* keep if under 24 months and living with mother
keep if b19 < 24 & b9 == 0
* and keep the last born of those. 
* if caseid is the same as the prior case, then not the last born
keep if _n == 1 | caseid != caseid[_n-1]

Previous Topic: Conindex results not matching.
Next Topic: Calculation age
Goto Forum:
  


Current Time: Sun Dec 22 04:05:21 Coordinated Universal Time 2024