Hi!
I have an issue trying to merge datasets and would really appreciate your help.
DATA_1
DATA_2
My wanted outcome is:
I have used the code
merge m:m id using "DATA_2.dta"
But that doesn't take into account that I want have a single observation per id2 as well as id and hence not working.
Thank you so much for the help!
Hanna
I have an issue trying to merge datasets and would really appreciate your help.
DATA_1
id | id2 |
1 | 1 |
1 | 2 |
2 | 3 |
3 | 4 |
id | var |
1 | a |
1 | b |
1 | a |
2 | b |
2 | c |
3 | a |
id | id2 | var |
1 | 1 | a |
1 | 1 | b |
1 | 1 | a |
1 | 2 | a |
1 | 2 | b |
1 | 2 | a |
2 | 3 | b |
2 | 3 | c |
3 | 4 | a |
I have used the code
merge m:m id using "DATA_2.dta"
But that doesn't take into account that I want have a single observation per id2 as well as id and hence not working.
Thank you so much for the help!
Hanna
Comment