Hi! I have a cross-sectional time-series dataset on conflicts and would like to add some country-specific information from another dataset.
My master dataset has 2,713 observations and my using dataset 13,054 observations.
The variables I intend to use for merging is country number (Number) and year (YEAR). The master dataset has duplicates on these variables (multiple conflicts pr. country and year), whereas the using dataset has unique observations, thus making me believe that merge m:1 is the correct command.
However, when i do that, no observations are matched:
This is despite the fact that a quick manual check of the datasets reveals that there are matching observations on these two variables.
I am pretty new to merging datasets, so any suggestions are appreciated!
Birte
My master dataset has 2,713 observations and my using dataset 13,054 observations.
The variables I intend to use for merging is country number (Number) and year (YEAR). The master dataset has duplicates on these variables (multiple conflicts pr. country and year), whereas the using dataset has unique observations, thus making me believe that merge m:1 is the correct command.
However, when i do that, no observations are matched:
Code:
. merge m:1 Number YEAR using "\\hume\student-u46\birthee\pc\Downloads\WDI CLEAN SORTED.dta" (variable location was str28, now str52 to accommodate using data's values) (variable YEAR was int, now long to accommodate using data's values) (label BOTH already defined) Result Number of obs ----------------------------------------- Not matched 15,767 from master 2,713 (_merge==1) from using 13,054 (_merge==2) Matched 0 (_merge==3) -----------------------------------------
I am pretty new to merging datasets, so any suggestions are appreciated!
Birte
Comment