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 #29816 is a reply to message #3219] Thu, 08 August 2024 13:19 Go to previous messageGo to previous message
Adetunji is currently offline  Adetunji
Messages: 7
Registered: August 2023
Member
Thanks for the code. I am doing the same analysis on Nigeria DHS and I need to merge the HW data with the KR file for DHS IV. While the code you shared worked well with no error code, it failed to produce any match. I think this because the caseid in the KR file has three characters in the string, whereas that of HW is only two. Could that be the reason and what do you advise I do?

Here is the code and the screenshot of the output:

use "${hw2003}", clear
ren hwhhid caseid
ren hwline midx
sort caseid midx
save "${kr2003}_temp.dta", replace

* Sort the children's recode data and then merge
use "${kr2003}", clear
sort caseid midx
merge 1:1 caseid midx using "${kr2003}_temp.dta"
 
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: Fri Nov 22 15:56:51 Coordinated Universal Time 2024