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
Difference-in-difference regression (?) with aggregate (state-level) pooled cross-sectional dataGreetings, I'm running Stata 15.1 on OSX and working with aggregate state-level data. My dependent …
Factorial ANOVA and MANOVA, how to run?How do I run a Factorial ANOVA and/or MANOVA in Stata 13? I can't seem to find any tutorials in orde…
How to adjust for large number of Observations being "ZERO" in my PROBIT modelDear Friends; I am running a Probit model where the dataset has a large number of zero values (98%) …
Vlookup in StataHello, There are four regions (Area Unit), and four people. The first table is the origin-destinati…
How to make a ttest with conditions?Hi! I don't know how to create a ttest for this null hypothesis: - H0: b1 +4b3 <= 50 - H1: b1 +4b…
Subscribe to:
Post Comments (Atom)
0 Response to Help in creating so many dummies
Post a Comment