Hi guys,
I am a Stata beginner and have a problem in generating a dummy called aggregate.
I tried it with inlist(), but as my list is very long I get an error message "Expression too long".
This is my code:
#delimit ;
gen aggregate = inlist(countryname,"Arab World", "Caribbean small states",
"Central Europe and the Baltics",
"East Asia & Pacific (all income levels)",
"East Asia & Pacific (developing only)",
"Euro area", "Europe & Central Asia (all income levels)",
"Europe & Central Asia (developing only)",
"Europe and Central Asia (IFC classification)",
"European Union", "Fragile and conflict affected situations",
"Heavily indebted poor countries (HIPC)",
"High income", "High income: nonOECD", "High income: OECD",
"Latin America & Caribbean (all income levels)",
"Latin America & Caribbean (developing only)",
"Latin America and the Caribbean (IFC classification)",
"Least developed countries: UN classification",
"Low & middle income", "Low income", "Lower middle income",
"Middle East & North Africa (all income levels)",
"Middle East & North Africa (developing only)",
"Middle income", "North America", "OECD members",
"Other small states", "Pacific island small states",
"Small states", "South Asia",
"Sub-Saharan Africa (all income levels)",
"Sub-Saharan Africa (developing only)",
"Upper middle income", "World"
),;
#delimit cr
Is there any smarter way to do that?
Related Posts with Inlist Expression too long
Family and link selection in GLMHi all, I have a continuous dependent variable varying between 0 and 1. There are lots of zeros, to…
Diff-in-Diff with multiple treatment periods and treatment magnitudes?I have a question regarding how to run a generalized diff-in-diff with treatments that are implement…
dropped data in xtlogit,fehi all, In the xtlogit regression below 17667 groups of data have been dropped. (All variables in th…
Multiple fixed effects using aregDear all, I am studying the determinants of peer group composition and use panel data with a sample…
Psmatch2 and 1000 repetitionsHello all! I would like to ask a help, please. I ran the psmatch2 and now i need to run 1000 times t…
Subscribe to:
Post Comments (Atom)
0 Response to Inlist Expression too long
Post a Comment