Dear all, I want to merge two datasets by age, for every age from 1-120 in my "age" dataset I have for example a different death rate, it looks like this;
In the other dataset for my population (the using dataset), I have a lot of observations and people who have the same age like this:
I tried this:
However, I get the error:
''variable age does not uniquely identify observations in the
using data''
I understand that this is the case because in the using data there are more persons with the same age. But, how to solve this?
age | death rate |
1 | .. |
2 | .. |
3 | .. |
4 | .. |
5 | .. |
6 | .. |
... | .. |
119 | .. |
120 | .. |
Age | Variable 1 |
1 | .. |
1 | .. |
1 | .. |
1 | .. |
5 | .. |
5 | .. |
... | .. |
80 | .. |
80 | .. |
Code:
merge m:1 age using "dta-files\populatie_def.dta"
''variable age does not uniquely identify observations in the
using data''
I understand that this is the case because in the using data there are more persons with the same age. But, how to solve this?
Comment