[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

From |
"Alex Gamma" <gamma@bli.unizh.ch> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
Re: st: Finding all variables NOT containing a string - SOLVED |

Date |
Tue, 9 Oct 2007 16:14:13 +0200 |

Hi Scott,

Yes, it works, and it's what I want. I've simply overlooked this although a similar example is actually given in the help-file, as I now see.

Thanks a lot!

Alex

----- Original Message ----- From: "Scott Merryman" <scott.merryman@gmail.com>

To: <statalist@hsphsun2.harvard.edu>

Sent: Tuesday, October 09, 2007 3:53 PM

Subject: Re: st: Finding all variables NOT containing a string

This does not work? -ds *tempsa*, not - Scott On 10/9/07, Alex Gamma <gamma@bli.unizh.ch> wrote:Hi Statasticians*

I have a simple problem, but wasn't able to find the solution:

I want to

a) find all variables whose names do NOT contain a given string (say,

"tempsa")

b) have them stored in r(varlist)

Neither -describe-, -lookfor-, nor -ds- seem to be able to do the job. I've

looked on the web and found Fred Wolfe's -lfsum-, which finds variables

containing a given string with the possibility to exclude other strings. But

this command is unable to handle wildcards, so that I cannot list ALL

variables except for those containing the string "tempsa". (Also it does not

store its results in r(varlist)).

I hope and assume that some of you will immediately know the solution since

this must be a frequently encountered problem.

Best regards,

Alex

--

Alex Gamma Ph.D.

University Hospital of Psychiatry

Research Department

Lenggstr. 31

8032 Zurich

Switzerland

Tel: +4144 384 2621

Fax: +4144 384 2446

e-mail: gamma@bli.uzh.ch

*

* For searches and help try:

* http://www.stata.com/support/faqs/res/findit.html

* http://www.stata.com/support/statalist/faq

* http://www.ats.ucla.edu/stat/stata/

* For searches and help try:

* http://www.stata.com/support/faqs/res/findit.html

* http://www.stata.com/support/statalist/faq

* http://www.ats.ucla.edu/stat/stata/

* * For searches and help try: * http://www.stata.com/support/faqs/res/findit.html * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**References**:**st: re: how do people learn Stata?***From:*Kit Baum <baum@bc.edu>

**st: Finding all variables NOT containing a string***From:*"Alex Gamma" <gamma@bli.unizh.ch>

**Re: st: Finding all variables NOT containing a string***From:*"Scott Merryman" <scott.merryman@gmail.com>

- Prev by Date:
**Re: st: Finding all variables NOT containing a string** - Next by Date:
**st: Question about fixed effect** - Previous by thread:
**Re: st: Finding all variables NOT containing a string** - Next by thread:
**st: R: replace command** - Index(es):

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