The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Nutrition and Anthropometry » MERGING HW FILE AND KR FILE NFHS2 (DHS IV) (code clarification)
MERGING HW FILE AND KR FILE NFHS2 (DHS IV) [message #29297] Thu, 23 May 2024 21:51 Go to previous message
Noyel Sebastian is currently offline  Noyel Sebastian
Messages: 11
Registered: March 2024
Member
Hello,

Can I merge the Height-Weight File for NFHS2 to the KR file and use it for child nutrition outcomes? Can you help me with the Stata code for the same? I tried to calculate scores in the KR file, but it only generated missing values. The code used is:

gen DOB=mdy(b1, b3, b2)
format DOB %d
format %tdMon_DD,_CCYY DOB
la var DOB "Date of Birth of children"
*
gen SVDate=mdy(hw18, hw17, hw19)
format SVDate %d
format %tdMon_DD,_CCYY SVDate
la var SVDate "Survey date"
*
gen cage= (SVDate-DOB)/30.4167
format %5.0g cage
la var cage "Age of children in month"
*
gen ch=hw3/10 if hw3<9000
gen cw=hw2/10 if hw2<9000
*
*----------Z score calculation--------
*
zscore06, a(cage) s(b4) h(ch) w(cw) male(1) female(2)
*
replace haz06 =. if haz06 <-6
replace haz06 =. if haz06 >6
replace waz06 =. if waz06 <-6
replace waz06 =. if waz06 >5
replace whz06 =. if whz06 <-5
replace whz06 =. if whz06 >5
*
gen stunting= haz06<-2 if haz06<.
la de stunting 1 "Stunted" 0 "Non-stunted", replace
la val stunting stunting
*
gen underweight= waz06<-2 if waz06<.
la de underweight 1 "underweight" 0 "Non-underweight", replace
la val underweight underweight
*
gen wasting= whz06<-2 if whz06<.
la de wasting 1 "wasting" 0 "Non-wasting", replace
la val wasting wasting


Why is this code not working?


Thank You

[Updated on: Thu, 23 May 2024 21:55]

Report message to a moderator

 
Read Message
Read Message
Previous Topic: Nutrition of children & adults
Next Topic: Height and weight value
Goto Forum:
  


Current Time: Mon Nov 25 09:46:09 Coordinated Universal Time 2024