Hello, I have a variable that contains names of around 50 towns.
I want to create a dummy variable for each town.
Is there an efficient way to do this? I want to avoid manually writing a code for each dummy (e.g. gen chicago_dummy = 1 if city == "chicago" or something).
I want to create a dummy variable for each town.
Is there an efficient way to do this? I want to avoid manually writing a code for each dummy (e.g. gen chicago_dummy = 1 if city == "chicago" or something).
Comment