Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: how do you merge a large dataset and small dataset together based on a unique id?


From   Gwinyai Masukume <parturitions@gmail.com>
To   statalist <statalist@hsphsun2.harvard.edu>
Subject   st: how do you merge a large dataset and small dataset together based on a unique id?
Date   Tue, 23 Apr 2013 13:29:43 +0200

Dear Stata listers,

I have two datasets and each has a unique id – the patient id.
One dataset (the larger) contains patient demographic data and the
other dataset (the smaller) contains the results of a laboratory test.
(Not all patients had the laboratory test done).

I would like to merge the two datasets.

I have tried a one to one merge based on the patient id. The two
datasets do merge, however a patient is paired with the wrong
laboratory result (i.e. a result which is not the patient’s, but
belonging to another patient).

How can I merge the two datasets so that the two datasets are
correctly merged (each patient with their correct lab result)?

Kind regards,
Gwinyai

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index