Hi.
I have a dataset including around 200 countries (and several observations for each country).
I would like to generate the following dummies: low_income; lower_middle_income; upper_middle_income; high_income.
The list of countries belonging to each group is obtained from the site of the WorldBank (http://data.worldbank.org/about/coun...lending-groups).
Since for each group the list of countries included is quite long, I was looking for an alternative to the command: replace low_income=1 if country=="Afghanistan"|county=="Gambia"....
Do you have any idea?
I was thinking to create several globals (like, for example: global low_income "Afghanistan Gambia, The Myanmar Bangladesh Guinea Nepal Benin"), but then I don't know how to say: replace low_income=1 if country belongs to global low_income.
Thank you for your help!
I have a dataset including around 200 countries (and several observations for each country).
I would like to generate the following dummies: low_income; lower_middle_income; upper_middle_income; high_income.
The list of countries belonging to each group is obtained from the site of the WorldBank (http://data.worldbank.org/about/coun...lending-groups).
Since for each group the list of countries included is quite long, I was looking for an alternative to the command: replace low_income=1 if country=="Afghanistan"|county=="Gambia"....
Do you have any idea?
I was thinking to create several globals (like, for example: global low_income "Afghanistan Gambia, The Myanmar Bangladesh Guinea Nepal Benin"), but then I don't know how to say: replace low_income=1 if country belongs to global low_income.
Thank you for your help!
Comment