I would like to merge two data sets that have in common string variables. If I first encode the string variable in one data set and then do the same in another data set, I end up with two variables that have been encoded differently. My merge no longer works properly, because the numerically assigned labels are different. How do I ensure that during encoding Stata assigns the same numerical labels for both data sets for string variables so that the merge works properly? Is there a way to create unique labels for each string category in each data set and then ask Stata to merge using the same labels?
-
Login or Register
- Log in with
Comment