Hi all,
I have a string variable with a lot of different categories. I would like to generate some dummy variables, that, for example, =1 if the word "assault" is in the string variable. Some example data below. Thanks for help in advance. -CJ
I have a string variable with a lot of different categories. I would like to generate some dummy variables, that, for example, =1 if the word "assault" is in the string variable. Some example data below. Thanks for help in advance. -CJ
Code:
clear input str100 max_charge "(182701A1) - Simple Assault" "(182701A1) - Simple Assault" "(182701A1) - Simple Assault" "(182701A1) - Simple Assault" "(182701A1) - Simple Assault" "(182702A2) - Aggravated Assault" "(182702A2) - Aggravated Assault"

Comment