The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Other countries » Merging IR and HIV data from Senegal 2005
Merging IR and HIV data from Senegal 2005 [message #3149] Thu, 23 October 2014 05:17 Go to next message
hannekeyserhegdahl is currently offline  hannekeyserhegdahl
Messages: 9
Registered: October 2014
Member
Hi!

I am trying to merge individual and male recode with the data on hiv from Senegal 2005 in STATA. I have already appended the male and individual recode into one dataset and sorted on v001, v002 and v003, and given the same names to the variables in the hiv dataset.

When I try to merge the individual/male dataset with the hiv dataset 1:1, I get the message "variables v001 v002 v003 do not uniquely identify observations in the master data." I have done exactly the same for the Senegal 2010-11 dataset without any problems.

I have read somewhere that I may have more than one observation for one ID or something, so I tried to merge m:1, and then it worked (7717 were matched and 10753 were not matched). However, I do not understand what this means to my dataset. Can I use this as it is and be happy with only 7717 matched or is there another way of doing this so that I can get a match on every observation. When I have done this on other countries and also on the Senegal 2010-11 dataset, I was able to get a match on every observation.

Thank you in advance for any help.

Hanne
Re: Merging IR and HIV data from Senegal 2005 [message #3153 is a reply to message #3149] Fri, 24 October 2014 11:13 Go to previous messageGo to next message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 805
Registered: January 2013
Senior Member
The many to one match will not have produced a useful dataset, so don't use that.

In the Senegal 2005 survey, there is one more variable that is required for matching.
In the HIV dataset,
rename hivstruct sconces

then with your women and men's data open, use
merge 1:1 v001 sconces v002 v003 using "hivdatafilesname"

Re: Merging IR and HIV data from Senegal 2005 [message #3167 is a reply to message #3153] Tue, 28 October 2014 11:15 Go to previous message
hannekeyserhegdahl is currently offline  hannekeyserhegdahl
Messages: 9
Registered: October 2014
Member
Thank you so much! Been wondering about this for a while..
Previous Topic: Philippines Migration and OFW
Next Topic: Honduras occupation variables
Goto Forum:
  


Current Time: Tue Dec 17 21:28:06 Coordinated Universal Time 2024