Hi Statalist,
I have a data set containg many variables, among them one is a multiple response variable (called rank1) containing the ranks from 0 to 11 separated by space and other multiple response variable (called rank2) containing the ranks from 0 to 11 unseparated (without space or comma etc), like
rank1
0 1 10 2 11 ' ' '
rank2
0110211 ' ' '
I want to generate a dummy variable for each rank in both multiple response variables and tried regexm but failed. I don't know how to proceed. Any help will be highly appreciated
Ashish
* Example generated by -dataex-. To install: ssc install dataex
clear
input str11 rank1 float rank2
"0 1 10 2 11" 110211
"1 11 0 9" 11109
"2 9 11 10" 291110
end
I have a data set containg many variables, among them one is a multiple response variable (called rank1) containing the ranks from 0 to 11 separated by space and other multiple response variable (called rank2) containing the ranks from 0 to 11 unseparated (without space or comma etc), like
rank1
0 1 10 2 11 ' ' '
rank2
0110211 ' ' '
I want to generate a dummy variable for each rank in both multiple response variables and tried regexm but failed. I don't know how to proceed. Any help will be highly appreciated
Ashish
* Example generated by -dataex-. To install: ssc install dataex
clear
input str11 rank1 float rank2
"0 1 10 2 11" 110211
"1 11 0 9" 11109
"2 9 11 10" 291110
end
Comment