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.. )
Related Posts with Creating dummy for unique value
Different I-square results for meta summarize and meta forestplot using random empirical Bayes methodHi The meta forestplot using random(ebayes) appears to produce a different value for the I2 result …
Trouble Generating Variable dependant on periodArray Above is a picture of a subset of my data. hs10 refers to a specific product being sold and m…
meta forestplot error in stata 16Hello I am running several meta forestplots for subgroups which worked fine in the version of stata…
Stata returning missing when converting string dateDear all, I have dates in two formats in a single variable one is 20-Apr-19 the other is 21-APRIL-20…
"Data have changed" dialog boxI searched the forum for this, but I didn't find anything. Sorry if it's a repeat question. In my w…
Subscribe to:
Post Comments (Atom)
0 Response to Creating dummy for unique value
Post a Comment