I need to filter for variables scattered throughout a large-ish dataset based on a combination of characters in the middle of the var names. Although this wildcard notation (awo*b~C) is not valid, it represents conceptually what I would like to filter. For example, I need to select all the variables from all waves (the wave # is the * in "awo*b~C) for scale "b" that have been recoded as "correct" indicated by the letter "C" added to the end of the original var name. I need to repeat variations on this for many different tasks.
This seems like a simple thing to do, but so far I see no obvious way to do this efficiently.
~~~Using ~ Stata14 ~ Windows~~~
This seems like a simple thing to do, but so far I see no obvious way to do this efficiently.
- Tried various wildcards (like * and ? and ~; in the variables manager and in command lines) .
- Search archives such as Stata Tips (like inlist and inrange).
- Also, the rather unsystematic construction of the var names does not lend itself to the ways I normally use loop functions like foreach or forvalues
~~~Using ~ Stata14 ~ Windows~~~
Comment