Hi everyone,
I experience problems while trying to merge 2 of my datasets. I have tried a lot of things already, but I can not figure out why it keeps telling me "Variable does not uniquely identify observations in the master data".
I have two datasets:
Dataset 1, containing two variables:
Dataset 2, containing a lot of variables (mentioned X, Y, Z for simplicity):
I want to merge on Cusip 1, so that the Gvkey will be matched to the right Cusip.
In my second dataset, there are Cusips that appear more than once. I want that Stata matches the Gvkeys to every corresponding Cusip.
I thought I had to do a 1:M merge, but every time when I try this, I get the error: "Variable does not uniquely identify observations in the master data".
When I look into my data, I don't see anything unusual...
I also tried one-to-one, one-to-many, and many-to-one, but it keeps giving me the same error.
Only when I try many-to-many it gives me an output, but since Stata describes in their manual to better avoid this option and to use one of the other three, I wanted to give that a try.
Is there anyone who could give me advice on why it isn't working? Thank you in advance!
I experience problems while trying to merge 2 of my datasets. I have tried a lot of things already, but I can not figure out why it keeps telling me "Variable does not uniquely identify observations in the master data".
I have two datasets:
Dataset 1, containing two variables:
Gvkey | Cusip 1 |
123456 | 000123 |
562589 | 000248 |
987654 | 015987 |
X | Y | Z | Cusip 1 |
000123 | |||
000123 | |||
000123 | |||
000248 | |||
etc. |
In my second dataset, there are Cusips that appear more than once. I want that Stata matches the Gvkeys to every corresponding Cusip.
I thought I had to do a 1:M merge, but every time when I try this, I get the error: "Variable does not uniquely identify observations in the master data".
When I look into my data, I don't see anything unusual...
I also tried one-to-one, one-to-many, and many-to-one, but it keeps giving me the same error.
Only when I try many-to-many it gives me an output, but since Stata describes in their manual to better avoid this option and to use one of the other three, I wanted to give that a try.
Is there anyone who could give me advice on why it isn't working? Thank you in advance!
Comment