The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Nutrition and Anthropometry » DHS Burundi 1987
Re: DHS Burundi 1987 [message #20173 is a reply to message #20144] Mon, 05 October 2020 14:53 Go to previous messageGo to previous message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 803
Registered: January 2013
Senior Member
You need to first merge the data with the PR file (which is the natural file to use for anthropometry for this survey), and then based on that to then merge the PR file with the KR file. Try the following code:

* First merge with PR file as we need the mother's line number plus the cluster and household number
use ETHW41FL.DTA, clear
rename hwhhid hhid
rename hwline hvidx
sort hhid hvidx
save ETHW41FL_sort.DTA, replace

*Members-PR file
use ETPR41FL.DTA, clear
sort hhid hvidx
merge 1:1 hhid hvidx using ETHW41FL_sort.DTA
keep if _merge==3

* Second merge resulting file with KR file
rename hv001 v001 
rename hv002 v002 
rename hc60  v003
rename hvidx b16
keep hhid v001 v002 v003 b16 hc7*
save ETHW41FL_sort2.DTA, replace

*Children-KR file
use ETKR41FL.DTA, clear
sort v001 v002 b16
* drop cases with no matching entry in the PR file
drop if b16==. | b16==0
merge 1:1 v001 v002 b16 using ETHW41FL_sort2.DTA

Note that there will be some cases in the using file that do not match. These are children listed (and weighed and measured) in the PR file that were not children of interviewed women.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Mothers education for IYCF indicators
Next Topic: Minimum acceptable diet
Goto Forum:
  


Current Time: Tue Nov 26 04:19:43 Coordinated Universal Time 2024