Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: AW: How to list variables with certain characters in the variable names?


From   [email protected]
To   statalist<[email protected]>
Subject   Re: st: AW: How to list variables with certain characters in the variable names?
Date   Sun, 23 Aug 2009 01:57:11 +0800

Martin,

thank you very much for your elaborate explanation,which makes me understand more.


Best regards,

Rose.

----- Original Message -----
From: Martin Weiss <[email protected]>
To: <[email protected]>
Subject: st: AW: How to list variables with certain characters in the variable names?
Date: 2009-8-23 01:21:18


<>


" 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黱gliche 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/

*
*   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index