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
New version of xcontract on SSCThanks as always to Kit Baum, a new version of the xcontract package is now available for download f…
Problems with mergeHi there, I was trying to merge two datasets (code:joinby), however it seems that stata cannot iden…
Panel 2sls with multiple interations of endogeneous variablesI´m using Stata 14 with Windows 10 OS. I have 2 endogenous and 8 exogenous variables. I need to run…
fuzzy fsQCA bestfit displaying few casesHello Statalist, I am conducting a fuzzy-set QCA using the 'fuzzy' package written by Longest &…
How to use tabstat's "format" option with estpost? Getting ErrorHi, I have a time variable in Stata internal form. I am trying to calculate it's summary statistics…
Subscribe to:
Post Comments (Atom)
0 Response to Help in creating so many dummies
Post a Comment