The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Nutrition and Anthropometry » Rwanda DHS 2014-15 ;Child Nutrition- Table 11.6
Re: Rwanda DHS 2014-15 ;Child Nutrition- Table 11.6 [message #12083 is a reply to message #12076] Mon, 27 March 2017 15:36 Go to previous messageGo to previous message
crlnhalcyn is currently offline  crlnhalcyn
Messages: 3
Registered: March 2017
Member
Many thanks for your reply, that really helped! I can now replicate the distribution using the code below.
I just wanted to check if the age variable (v008-b3) I am using is correct?

The code I have now is:
*** Find the youngest child living with mother and keep if age 6-23 months ******
**check age in months
gen age = v008-b3
*sort
sort caseid bidx
*Keep if :
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)
*child is living with mother (b9=0)
keep if b9==0
*Check if the child is the youngest
drop if _n > 0 & caseid == caseid[_n-1]
*drop if child is less than 6
drop if age<6
*to match the distribution in table 11.6
svy: tab child_age,count

Many thanks again!

[Updated on: Mon, 27 March 2017 15:37]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: cameroon 1998 v002
Next Topic: how to download a data set
Goto Forum:
  


Current Time: Fri Jul 12 04:28:11 Coordinated Universal Time 2024