The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Child Health » Double burden of malnutrition (Using STATA14SE)
Re: Double burden of malnutrition [message #18194 is a reply to message #18175] Wed, 09 October 2019 16:32 Go to previous messageGo to previous message
Liz-DHS
Messages: 1516
Registered: February 2013
Senior Member
Dear Wonil, a more detailed response from Dr. Tom Pullum based on some input from you:
Quote:
Dear Wonil,

Your "use" line has dropped the hw70-hw72 variables. You need to put them back in. You don't need hidx* and hidxa*. That is, change the "use" line to this:

use v0* v1* v4* seduc v714 h32l* h32a* m18* b4* hw1* h11* m39a* m39* h80a* h80b* h80c* h15j* h15e* hw70* hw71* hw72* using "E:\졸업 논문\교수님 2차 (by 19.07.15)\파키스탄 데이터\PK_2017-18_DHS_07252019_2215_133252\PKIR71DT\PKIR7 1FL.DTA " , clear

Your "use" line includes "hw1*. That brings in hw1 and hw10-hw19 (but there is no hw14). In the "reshape" line you will need to list these separately. "m39*" brings in both m39* and m39a*, so you can drop "m39a*".


The "b" variables, including "b4", come from the birth history and have indices 01 through 20. The variables for children under 5 have indices 1-6. You need to add the following lines to change b4:

gen b4_1=b4_01
gen b4_2=b4_02
gen b4_3=b4_03
gen b4_4=b4_04
gen b4_5=b4_05
gen b4_6=b4_06
drop b4_0* b4_10-b4_20
You need to modify the "reshape" command to include hw70-hw72 and replace the "*" with "_":
reshape long h32l_ h32a_ m18_ b4_ hw1_ h10_ h11_ h12_ h13_ h15_ h16_ h17_ h18_ h19_ m39a_ m39_ h80a_ h80b_ h80c_ h15j_ h15e_  hw70_ hw71_ hw72_,  i(v001 v002 v003) j(hidx)

Therefore. the following lines will work (after you have changed the path):
use v0* v1* v4* h32l* h32a* m18* b4* hw1* m39* h80a* h80b* h80c* h15j* h15e* hw70* hw71* hw72* using ...PKIR71FL.DTA", clear

gen b4_1=b4_01
gen b4_2=b4_02
gen b4_3=b4_03
gen b4_4=b4_04
gen b4_5=b4_05
gen b4_6=b4_06
drop b4_01-b4_20

reshape long h32l_ h32a_ m18_ b4_ hw1_ hw10_ hw11_ hw12_ hw13_ hw15_ hw16_ hw17_ hw18_ hw19_ m39a_ m39_ h80a_ h80b_ h80c_ h15j_ h15e_  hw70_ hw71_ hw72_,  i(v001 v002 v003) j(hidx)
rename *_ *

Good luck--Tom
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Health facilities considered for ARI treatment
Next Topic: Vitamin A supplements in last 6 months
Goto Forum:
  


Current Time: Thu Mar 28 17:27:13 Coordinated Universal Time 2024