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
reshape in StataDear All, I have some issues about reshape. Here is the original matrix I have. Code: * Example gen…
Converting string to date/time variables fails somehowHello Statalist community, I am struggeling with converting a string containing date and time inform…
Question about Goodness of fit resultHi, I am running a SEM model on Stata. I've 5 IVs, 1 mediator, and DV. with the sample size of 400. …
VISUA Dialog programming GUII have seen the presentation on the below link, they have used a VISUA GUI for creating Stata Dialog…
Help with reshapeHello everyone, I have got the following matrix. * Example generated by -dataex-. To install: ssc …
Subscribe to:
Post Comments (Atom)
0 Response to Creating dummy for unique value
Post a Comment