v001 v002 v003 doesnot uniquely identify observation [message #3072] |
Sun, 12 October 2014 23:32 |
kalfikirsisay@gmail.com
Messages: 11 Registered: October 2014 Location: NL
|
Member |
|
|
Hi All,
I am using Ethiopian DHS2011 for my analysis. I need to merge birth recode file (using file) with HH member recode(master file). I tried to see the DHS merging guide and related topics in the FAQ. I was aware of the fact that HIDX is the household line number and used the following STATA command to merge,
gen gen v001= hv001
gen v002 = hv002
gen v003= hvidx
sort v001 v002 v003
merge m:1 v001 v002 v003 using "the birth recode file"
neverthless, I could'nt succed in merging and STAT propmted me the messgae " v001 v002 v003 doesnot uniquely identify the observation in using file". would you please quickly tip me on how to merge the two recodes?
Thanks in advance,
Kal
|
|
|
|
|
|
Re: v001 v002 v003 doesnot uniquely identify observation [message #3081 is a reply to message #3080] |
Mon, 13 October 2014 11:43 |
kalfikirsisay@gmail.com
Messages: 11 Registered: October 2014 Location: NL
|
Member |
|
|
dear Trevor,
thanks for quick response
I tried using 1:1 merge command only to get simialr message from STATA as before. I couldnot figure out why this is so, the following was the exact code I used.
use "C:\Users\mademsei\Desktop\CSA data and reports\Biomaker manual\merging files for bio\HH member recode\ETPR61FL.DTA", clear
gen v001 = hv001
gen v002 = hv002
gen v003= hvidx
sort v002 v002 v003
merge 1:1 v001 v002 v003 using "C:\Users\mademsei\Desktop\birth 1 to 1 merge.dta"
variables v001 v002 v003 do not uniquely identify observations in the using data
The master file I am using is HH member and the using file is birthrecode. Neverthless, I used the 1:m merge and get matched data albeit many observations(over 66000) were not matched. This is the table I obtained from 1:m merge command.
merge 1:m v001 v002 v003 using "C:\Users\mademsei\Desktop\birth 1 to 1 merge.dta"
Result # of obs.
-----------------------------------------
not matched 66,848
from master 66,848 (_merge==1)
from using 0 (_merge==2)
matched 45,540 (_merge==3)
-----------------------------------------
Is this the right way? I am a bit sceptic of the merging approach, I thought either m:1 or 1:1 to be proper, ofcourse I merged all observations in my using file and this what I need to appear in the maser file. your last comment on this is of prior value,Thanks in advance,
Kalkidan Sisay
[Updated on: Mon, 13 October 2014 11:58] Report message to a moderator
|
|
|
|
Re: v001 v002 v003 doesnot uniquely identify observation [message #3083 is a reply to message #3082] |
Mon, 13 October 2014 12:41 |
kalfikirsisay@gmail.com
Messages: 11 Registered: October 2014 Location: NL
|
Member |
|
|
Dear Trevor,
Many thanks for your extended helps,
My objective is to have a data set containing HIV test result, anemia test result ,other biomarkers(nutrition and vaccine) and other diseasses like diarrhoea prevalence and treatements (I also needed malaria but thanks to DHS experts, one expert told me the Eth. DHS has no data on it).I choose birth recode, hiv recode and HH memeber recode files as candisate files to merge them so that I can have one file contining the aforementioned inforamtion for my analysis (disease prevalence and treatements).
Thanks in advance
Kalkidan S.
[Updated on: Mon, 13 October 2014 12:43] Report message to a moderator
|
|
|
|
|