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
When Stata if command is false, calling on Mata causes errorsHi everyone, Using Stata 15.1 MP8, I've encountered a variety of errors that seem to be caused by ca…
Fixed effects (in Accelerated Failure Time Survival Model), Cross-sectionalHi, For my research I am examining private equity strategies and their subsequent exit-types. My da…
After regression, how can I do calculation using r2 and N?After regression, I want to calculate the scalar, that is r2*N How should I do that? I know my bad …
Fixed effects (in Accelerated Failure Time Survival Model)Hi, For my research I am examining private equity strategies and their subsequent exit-types. My da…
range function generating over 400 missing valuesHello, I am trying to make a Stata variable that stores 20 numbers between 0 and 1. I am using the …
Subscribe to:
Post Comments (Atom)
0 Response to Inlist Expression too long
Post a Comment