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: how do you merge a large dataset and small dataset together based on a unique id?


From   Gwinyai Masukume <[email protected]>
To   statalist <[email protected]>
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index