Hey,
For my dataset I have 20+ years of data with 19 unique countries per year
I want to create 1 column where every country gets its own dummy number, without typing everything out like so:
generate countrydummy = 0
replace countrydummy =1 if Country == " Austria"
replace countrydummy =2 if Country == "Belgium"
etc..
Is there a way to efficiently create a dummy for every country? (I do not want to use: tabulate Country, generate(countrydummy) because I will get 19 columns.. )
0 Response to Creating dummy for unique value
Post a Comment