Dear All,
I want to generate dummy variables from a string variable cards_hh which has response like ABCD (without any space). I have tried split command but gives me error.
split cards_hh , generate(resp) destring
cannot generate new variables using stub resp
r(110);
. split cards_hh , generate(resp) destring
variable born as string:
resp1
resp1: contains nonnumeric characters; no replace
Any help is highly appreciated.
Thanks
Ashish
I want to generate dummy variables from a string variable cards_hh which has response like ABCD (without any space). I have tried split command but gives me error.
split cards_hh , generate(resp) destring
cannot generate new variables using stub resp
r(110);
. split cards_hh , generate(resp) destring
variable born as string:
resp1
resp1: contains nonnumeric characters; no replace
Any help is highly appreciated.
Thanks
Ashish
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str4 cards_hh "B" "A" "AC" "C" "AC" "AC" "A" "A" "AB" "AB" "AC" "AC" "AC" "ABCD" "ABC" "AC" "AC" "A" "AC" "A" "A" "A" "ACD" "ABC" "AC" "ABC" "D" "ABC" "AC" "AC" "AC" "AC" "AC" "AC" "ABC" "AB" "AC" "AC" "AC" "AC" "AC" "AC" "AC" "AC" "AC" "AC" "ACD" "ABD" "ACD" "ACD" "ABCD" "ABD" "ABD" "ACD" "ACD" "ACD" "ACD" "ACD" "ACD" "ACD" "ACD" "ACD" "ACD" "ABC" "ACD" "AD" "ACD" "ACD" "D" "ACD" "ABC" "AC" "AC" "A" "AC" "ABD" "ACD" "AB" "ACD" "AC" "AC" "ABC" "AC" "ACD" "ABC" "AC" "C" "C" "AC" "C" "ABC" "C" "AC" "AC" "AC" "AC" "ABC" "AC" "A" "AC" end

Comment