<>
" I want to list variables..."
Your request has been answered to your full satisfaction, but note that
"list" could mean several things. -ds- is most helpful if you want the set
of variables satisfying your condition assembled in a return value.
If all you wanted was to run some command on these variables, any command
that takes a -varlist- will happily expand the "*x*" thing for you, and no
detour via -ds- is necessary.
***
clear
set obs 10
gen x =runiform()
gen yx=4
gen r=2
gen zerx=rnormal()
reg ze *x*
***
Also note that -lookfor x- would also yield the same result...
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von [email protected]
Gesendet: Samstag, 22. August 2009 17:40
An: statalist
Betreff: st: How to list variables with certain characters in the variable
names?
Dear statalists,
How to list variables with certain characters in the variable names?
I think -ds- could produce something I need. However, I did not find
a solution in -ds-.
For example, I have variables x, jj,aa,bb,yxz,xxj, ix in the dta.
I want to list variables x, yxz,xxj,ix, which has a character "x"
in the variable names.
Thank you for any help.
Best regards,
Rose.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/