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
How to deal with overlapping obs in healthcare dataHi all, I have two data sets on healthcare costs during the past 12 months, in which one is at indi…
Merge error (ID matched but merged data sometimes erroneous)Hello Everybody, This is my second time posting, so I’m going to try to add additional information …
Outreg2 specific tables - and not the last one per defaultHi, We wunder if we can "outreg" results from a regression, where we "bysort" per country, and ther…
Create a pivot table and then write to excelI'm pretty sure this should be easy, but...... I have created a pivot table using the table functio…
How to deal with the "(texdoc do not running; nothing to do)" error in case of HTML TablesHi Guys, Hereby I would like to ask a question regarding the (texdoc do not running; nothing to do)…
Subscribe to:
Post Comments (Atom)
0 Response to Help in creating so many dummies
Post a Comment