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
Selectively list date variable as matrix row name using macroGreetings, I'm hoping for some aid here. Having searched the forum for a solution, I've yet to find …
Obtaining main results after jwdidHello, I have just started to use jwdid command, however, I cannot see the effect on main coefficien…
Code help: Monte Carlo simulationI've attached a small Do file for a Monte Carlo Simulation I am running for an economics class. For …
How to get the predicted value of each group?Dear all, I want get the predicted value of each regression of each group? Here is an example. Co…
Cluster based on string similarityHey Community, I'm quite new to working with Stata and therefore desperately looking for help! I ha…
Subscribe to:
Post Comments (Atom)
0 Response to Creating dummy for unique value
Post a Comment