Code:
clear all sysuse auto ds, has(type string) unab allvars: _all unab vars_to_exclude: make replace mpg =. if mpg >33 foreach i in `:list allvars - vars_to_exclude' { display "`i'" list `i' if `i'==. } price mpg +-----+ | mpg | |-----| 43. | . | 57. | . | 66. | . | 71. | . | +-----+ rep78 +-------+ | rep78 | |-------| 3. | . | 7. | . | 45. | . | 51. | . | 64. | . | +-------+ headroom trunk weight length turn displacement gear_ratio foreign
Code:
*Just an idea: ds, has(vlist) mpg rep78 or foreach v of local vlist { di "`v'" } mpg rep78
Please any advice I would grateful
Regards
Rodrigo
0 Response to How get variable list for a condition
Post a Comment