The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » Duplicates in IR file when merging
Re: Duplicates in IR file when merging [message #8914 is a reply to message #8784] Wed, 13 January 2016 08:18 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3214
Registered: February 2013
Senior Member
Following is a response from Senior DHS Stata Specialist, Tom Pullum:

If you list out caseid and v003 for the first few cases in the IR file, and list out hhid for the first few cases in the HR file, you will see that caseid is simply a combination of hhid and v003.

Both caseid and hhid are character strings (str15 and str12, respectively); v003 is numeric.

Before you do the merge, when you open the IR file, use this line: gen hhid=substr(caseid,1,12). Then merge with the IR file using hhid. I think this will work for what you want to do, but let me know if it does not.
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Child Unique Identifier
Next Topic: Malaria Indicator Survey: Malaria outcomes and women's characteristics
Goto Forum:
  


Current Time: Mon Dec 23 22:13:28 Coordinated Universal Time 2024