Hi there,
I have 2 datasets; one shows the data of patients who were diagnosed with cancers and the other one shows the details of medications they use. Both datasets have multiple rows for one patient (ex: multiple cancers for 1 patient in the cancer data and multiple medicines for 1 patient in the medication data). I want to merge these 2 datasets to find out how is the medication use of patients with cancers. As this will be a m:m merging I’m not sure whether the usual stata code will appropriately work out.
Below is a part of 2 datasets that I want to get merged. Highly appreciate if you can help me to find a suitable command to merge them properly.
Thank you in advance!
Thushani
Medication dataset
input str11 ID str1 gender long medication_code float(frequency daily_dose)
"1" "M" 70238 1 1
"1" "M" 70238 1 1
"1" "M" 70238 1 1
"2" "F" 70238 1 1
"2" "F" 67117 1 1
"2" "F" 67117 1 1
"3" "M" 67117 1 1
"3" "M" 70238 1 1
"4" "F" 74121 1 1
"4" "F" 67265 1 1
"4" "F" 67265 1 1
"5" "M" 70238 2 2
"5" "M" 70238 2 2
"5" "M" 70238 2 2
"5" "M" 70238 2 2
Cancer dataset
input str11 ID str1 gender int age str4 site int morph
"1" "M" 79 "C160" 8070
"2" "F" 74 "C20" 8140
"2" "F" 74 "C187" 8140
"2" "F" 74 "C250" 8140
"3" "M" 75 "C187" 8140
"3" "M" 75 "C250" 8000
"4" "F" 85 "C259" 8000
"4" "F" 85 "C187" 8140
"4" "F" 85 "C250" 8000
"5" "M" 78 "C187" 8140
"5" "M" 78 "C187" 8140
"5" "M" 78 "C221" 8160
"5" "M" 78 "C20" 8140
"5" "M" 78 "C20" 8140
Related Posts with m:m merging - clarification
Effect of Endogeneity on SignificanceDear Statalist, I have a fairly simple doubt, forgive me if it's rather basic, but I was wondering …
Testing correlation of two variables with many variablesHi I have the following variables drought_rp, flood_rp, *_rms *_rms represents 50 variables with _rm…
Fuzzy match and group names within a listHi there! I have a long list of mutual fund names ever appeared in CRSP. I want to fuzzy match and g…
How to test if the sum of two parameters are zero when we use mlogit command?Hi I want to know how to test if the sum of two parameters are zero in the mlogit context. <Nota…
Creating graphs showing survival curves with confidence intervals on multiple record dataHi Statalist. Is there a way to show survival curves with confidence intervals for multiple-record …
Subscribe to:
Post Comments (Atom)
0 Response to m:m merging - clarification
Post a Comment