Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Puzzling error with merge


From   Joe Canner <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: Puzzling error with merge
Date   Mon, 13 Jan 2014 16:28:09 +0000

David,

I find that my eyes play tricks on me when I try to look at a frequency distribution to determine if the identifier is unique.  Just to be on the safe side, see what happens when you do the following on the master data set:

duplicates report StudyID

Regards,
Joe Canner
Johns Hopkins University School of Medicine

________________________________________
From: [email protected] [[email protected]] on behalf of David Hoaglin [[email protected]]
Sent: Monday, January 13, 2014 7:42 AM
To: [email protected]
Subject: st: Puzzling error with merge

Dear All,

I attempted to merge two datasets, each of which has 247 observations,
with the following command:

merge 1:1 StudyID using Sheet2

(here "Sheet2" is the last part of the fully qualified name of the
file, recently imported from Excel).

I received the following error message: "variable StudyID does not
uniquely identify observations in the master data".

I then tabulated StudyID in the two files.  Each output showed no
frequency other than 1 and a total of 247 observations.

What am I doing wrong?

I am using Stata 13.1.

Thanks for your help.

David Hoaglin
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index