You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
key variable id1 is str5 in master but byte in using data
key variable id3 is str12 in master but int in using data
Each key variable -- the variables on which observations are matched -- must be of the same generic type
in the master and using datasets. Same generic type means both numeric or both string.
The text was updated successfully, but these errors were encountered:
join seems to require that key variables are of the same generic type. Is this related to the hashing algorithm? It seems to be fine with both being strings or both being numeric but not one of each.
Minimal example:
* generate data
clear
* master dataset
set seed 09092019
set obs 10
gen string_id ="A"replace string_id ="B" if _n > 5
gen number_id = int(runiform() * 2)
save temp_master_dataset, replace
* using dataset
duplicates drop
gen usingvar ="BLA"* (number_id + 1)
tostring number_id, gen(number_id_tostring)
save temp_using_dataset, replace
use master, clear
* error when joining
join, from(temp_using_dataset) by(string_id number_id)
* case with no error when using only strings
tostring number_id, gen(number_id_tostring)
join usingvar, from(temp_using_dataset) by(string_id number_id_tostring)
EG:
The text was updated successfully, but these errors were encountered: