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
Calculating the turning pointHi, My name is Jan, and I would like to find the turning point for my regression. I looked at previ…
Rolling window standard deviation of residuals in ARIMADear Statalist community, I have trouble writing the code and would greatly appreciate your help. …
Diff in diff with IV for treatment dummyHi all, For my data analysis, I am estimating a difference-in-difference model of the sort Code: …
Delete observations within timespan of each otherDear all, I am writing my Master's Thesis and am currently cleaning my data. For each Company I wan…
marginsplot generating hard-to-read picturesDear All, I am running > marginsplot, recast(scatter) to illustrate margins & CIs and what re…
Subscribe to:
Post Comments (Atom)
0 Response to Creating dummy for unique value
Post a Comment