The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » STATA code merge IR and MR into HR files (STATA code merge IR and MR into HR files)
STATA code merge IR and MR into HR files [message #19441] Mon, 22 June 2020 05:52 Go to next message
elena.segarra is currently offline  elena.segarra
Messages: 2
Registered: June 2020
Member
Hello,

I need to merge the women and male databases into the household one, I tried to do it separately and it was successful for the women datafile but when I repeated the process for the male one STATA says merge is already defined.

Could somebody help me? maybe I have first to merge male and women and then to household? if it is that way, how could I do it?

Thanks in advance
Re: STATA code merge IR and MR into HR files [message #19486 is a reply to message #19441] Tue, 30 June 2020 16:32 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 1821
Registered: February 2013
Senior Member

Following is a response from DHS Research & Data Analysis Director, Tom Pullum:


If you want to merge the women's and men's data onto the same record, based on their identification of each other as spouses or partners, then it will be best to download the "CR" or "couples recode" file. This can be tricky to construct on your own, and that's why it's one of the standard recode files prepared by DHS.

Re: STATA code merge IR and MR into HR files [message #19525 is a reply to message #19486] Tue, 07 July 2020 03:14 Go to previous messageGo to next message
elena.segarra is currently offline  elena.segarra
Messages: 2
Registered: June 2020
Member
Good morning,

I can not use the couples datafile since I need the whole list of individuals, not only the married ones.

Thank you
Re: STATA code merge IR and MR into HR files [message #19536 is a reply to message #19525] Tue, 07 July 2020 15:36 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 1821
Registered: February 2013
Senior Member

Following is a response from DHS Research & Data Analysis Director, Tom Pullum:

When you do a merge, Stata constructs a variable called "_merge". Note the underscore before the word. Its values are mainly 1, 2, 3 and are defined in "help merge". You need a line "drop _merge" before you do a second merge.
Previous Topic: Linking mothers to children in the IR file
Goto Forum:
  


Current Time: Tue Jul 14 01:38:27 Eastern Daylight Time 2020