The outcome that I want is Dataset 2 has new variables from dataset1, and it corresponds to the bostonid.
For example, bostonid dh-bos-1066-001, with the patient's age, sex, and New Variable's observation.
I tried to combine, form pairwise combination within groups, BUT I ended up with MORE bostonid, and more observations in age,sex,etc. Dataset1 does have more observations of bostonid than dataset2. But I do not want "new" bostonid added into my dataset2. How do I go about this?
I tried merge m:1 as well, but it says my new variables are not found. So I generated the new variables in dataset2 using "gen rs928167= ." Then I merge m:1 again. It then says rs928167 "is str3 in master but float in using data
You could specify merge's force option to ignore this string/numeric mismatch. The using variable would then be
treated as if it contained "".
I tried to combine database with merge 1:1 it says the new variables do not uniquely identify observations in the master data
I got response from STATA technician saying that
"You have a "rs928167" in both datasets, you will need to either -rename- one of
the variables so that there is not a conflict or if you are trying to
merge the variables in both dataset you will need to change the storage
type with a command like -tostring-."
I renamed it, then when I try to merge it says the variable does not exist.
I destring the rs928167 as well, and created a new variable for it, and merge again, still it says the destrung new variable does not exist.
What should I do now?
Comment