I was wondering if anyone could help me with the following:
I have a panel database with patients ids, test dates, and the results of exams from a given machine x.
Another database has the ids (not always the same in both databases), test dates (not always the same in both), and results from machine y.
Some patients underwent exams x and y on different days.
I would like to combine the two databases by id and test date but only matching the ids of patients that had both tests done within +/- 5 days.
Any thoughts?
Here is what the data look like:
Database 1:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float id double testdate float x 1 21206 10 1 21236 12 1 21246 11 2 21201 13 2 21215 14 2 21228 12 3 21208 11 3 21210 10 3 21218 9 end
Database 2:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float id double testdate float y 1 21206 200 1 21236 150 1 21246 180 2 21201 120 2 21215 205 2 21228 100 3 21208 95 3 21210 110 3 21218 130 end
Thank you!
0 Response to Combining two panel databases
Post a Comment