Hi all,
I am trying to merge two files by date, Dataset - 1 that has multiple identical dates, and Dataset 2 that has single instances dates with variables, that will need to be assigned multiple times. Essentially I am using the date as an identifier, because the different companies will experience the factor I am trying to merge identically and so no differentiation is required on a company basis. I have searched this forum and found similar threads but not one that directly answered my question.
The merge m:m function yields no matches, and if helpful gives the below. All the other combinations m:1 etc result in errors. A simple version of what I am trying to achieve has been inserted below.
As an aside I am not allowed to match these up outside STATA in excel for instance which I'm aware would be much, much easier.
Result # of obs.
-----------------------------------------
not matched 554,625
from master 554,427 (_merge==1)
from using 198 (_merge==2)
matched 0 (_merge==3)
Thanks in advance,
Toby
I am trying to merge two files by date, Dataset - 1 that has multiple identical dates, and Dataset 2 that has single instances dates with variables, that will need to be assigned multiple times. Essentially I am using the date as an identifier, because the different companies will experience the factor I am trying to merge identically and so no differentiation is required on a company basis. I have searched this forum and found similar threads but not one that directly answered my question.
The merge m:m function yields no matches, and if helpful gives the below. All the other combinations m:1 etc result in errors. A simple version of what I am trying to achieve has been inserted below.
As an aside I am not allowed to match these up outside STATA in excel for instance which I'm aware would be much, much easier.
Result # of obs.
-----------------------------------------
not matched 554,625
from master 554,427 (_merge==1)
from using 198 (_merge==2)
matched 0 (_merge==3)
Dataset 1 | Dataset 2 | Merge | ||||||||||
Date | Company | Date | Macro Factor | Date | Company | Macro Factor 1 | ||||||
30/09/1965 | Company A | 30/09/1965 | 3 | 30/09/1965 | Company A | 3 | ||||||
30/09/1965 | Company B | 31/12/1965 | 5 | 30/09/1965 | Company B | 3 | ||||||
31/12/1965 | Company C | 31/12/1965 | Company C | 5 |
Toby
Comment