I have been trying unsuccessfully to merge three Stata files that I originally imported from MS Excel against a 6 character string ID code (e.g. n5fpeb
). They are stored as str6
variables in the Stata data files.
I have recorded some other variables that also identify each observation--a numeric participant ID and a school ID number, as each participant is a school pupil. My master dataset is in stacked format, because my data is longitudinal. When I attempt a 1:m merge (i.e. merge 1:m id using "C:\Users ... May.dta", generate(_merge1)
), Stata returns the following error message : variable id does not uniquely identify observations in the master data
.
I've read various guides, but can't figure out why the datasets won't merge. Could I be using the wrong command? Or perhaps the string variables, or multiple string variables, are confusing Stata? I'd like to learn how to cleanly add future observations to my master dataset.