Hi
I have a data set of 94 countries and number of observations for each country is different.
These countries are divided in 3 groups, by a variable name countryrank which takes values as 1, 2 or 3 for each country showing in which group the country falls.
I want to create dummy variables for each country falling in a specific group i.e. dummy variable d11 = 1 if it is the 1st country in countryrank = 1, d12 = 1 for 2nd country in countryrank = 1 and so on ... Similarly d21 if it is the 1st country in countryrank = 2 ....
Country variable is already coded
Is there any way to do it smartly or i have to use gen command 94 times?
Related Posts with Help in creating so many dummies
heteroscedasticity test white vs BPHello, I was checking my model for heteroscedasticity, and weird enough, I found a different outcom…
Help interpreting within a factor variableHi, I'm trying to calculate the probability of a movie having a sequel (hassequel) and am strugglin…
How to compare effect independent variable over 2 periods?Dear Statalist, For my thesis I examine the effect of producing renewable energy on firms in the en…
Cumulative incidence estimation in the presence of competing risksGood evening, In the last two days I'm dealing with "Cumulative incidence estimation in the presenc…
Mean Centering Variable for InteractioneffectDear Statalists I'm in the final phase of my research and I want to look into the interaction effec…
Subscribe to:
Post Comments (Atom)
0 Response to Help in creating so many dummies
Post a Comment