Hello Stata Community
I have a very big number of observations and I want to filter out the ones which contain at least one of the 20 key words I have. The problem is, that the observations are sentences and not just one word.
I have tried the command:
keep if inlist(Resolution,"drill" , "dioxin" , "clean up" , "nuclear" , "environment" , "environmental" , "pollution" , "energy" , "power" , "chlorine" , "trees" , "GHG" , "emissions" , "forest" , "recycling" , "recycled" , "mercury" , "water" , "filter" , "gene-engineered" , "mining" , "PVC" , "old growth wood" , "waste" , "paper" , "radioactive" , "toxic" , "plutonium" , "renewable" , "greenhouse gas" , "climate" , "CO2" , "parabens" , "phthalates")
but there is always an error saying that the expression is to long.
Do you have an idea, how I could do this? Thank you very much for your help.
Related Posts with Keep variables if they contain at least one word of a given list
Local macro in "forvalues" functionMy first post here, but have used this forum extensively in the past to trouble shoot. However, can'…
reshape or stack?Dear All, I have this data set: Code: * Example generated by -dataex-. To install: ssc install data…
Identify excluded observations from mixedI'm working with longitudinal panel data and running models using the mixed command. In prepping the…
-mi estimate- used for analysis of imputed variables only?I have used multiple imputations on 2 variables, say a and b. Specifically, for some simplified mod…
How to evaluate the appropriateness of instruments with xtivreg?I need to estimate an instrumental variable model with GLS random-effects (RE) model: xtivreg, re T…
Subscribe to:
Post Comments (Atom)
0 Response to Keep variables if they contain at least one word of a given list
Post a Comment