I am merging different datasets using "merge 1:1" option in STATA 17. I merge on two key variables: "country" or "ccode" and year. I want to import "uaeexport" variable into my first dataset. Country codes are unique. I really don't understand why I couldn't do it.
Year: Int
Iso: Float
My first dataset: (Master data)
country UAEODA iso ccode year turkeyoda
Aruba 0 533 ABW 2000 0
Aruba 0 533 ABW 2001 0
Aruba 0 533 ABW 2002 0
Aruba 0 533 ABW 2003 0
Aruba 0 533 ABW 2004 0
My Second Dataset:
country year uaeexport iso ccode
Afghanistan 2000 129559.63 4 AFG
Afghanistan 2001 80161.099 4 AFG
Afghanistan 2002 190925.73 4 AFG
Afghanistan 2003 163179.8 4 AFG
Afghanistan 2004 262686.2 4 AFG
Afghanistan 2005 469253.61 4 AFG
(the order of the countries is different)
My code:
merge 1:1 ccode year using uaeexport
Error:
variables ccode year do not uniquely identify observations in the master data
Comment