Hi all,

I wonder if its possible save or store a list of variable names with a specific condition, example:

Code:
clear all

sysuse auto

ds, has (type numeric)

foreach y of varlist `r(varlist)' {
 sum `y'

 if `r(mean)' > 3000 local flag="major"
 if `r(mean)' < 3000 local flag="minor"

 di "`flag'"
}
I this case i would like get variable names (could be like local list names?) for only mean> 3000 (price and weight) .

In my mind I think in use this local list names with reg command:

reg turn `list_names_ major'

Thanks in advance
Rodrigo