Hi all,
I am trying to merge two datasets, dataset A and dataset B. Dataset A has variables gvkey and fyear (but no variable ID). Dataset B has variables gvkey, fyear, and ID. However, there are some groups (gvkey fyear) in dataset B ,the var_ID have more than one value, so when I try to remove duplicates using "duplicates report gvkey fyear", it shows that there are duplicates in terms of gvkey and fyear.
But using "duplicates report gvkey fyear ID", the result report as 0 duplicate.
Now, I need to merge these two datasets while keeping all the ID values and their corresponding derived values in dataset B. How can I do this?
Thanks in advance for your help!
Best,
Cristiana
I am trying to merge two datasets, dataset A and dataset B. Dataset A has variables gvkey and fyear (but no variable ID). Dataset B has variables gvkey, fyear, and ID. However, there are some groups (gvkey fyear) in dataset B ,the var_ID have more than one value, so when I try to remove duplicates using "duplicates report gvkey fyear", it shows that there are duplicates in terms of gvkey and fyear.
But using "duplicates report gvkey fyear ID", the result report as 0 duplicate.
Now, I need to merge these two datasets while keeping all the ID values and their corresponding derived values in dataset B. How can I do this?
Thanks in advance for your help!
Best,
Cristiana

Comment