Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

Re: st: deleting variables based on a certain condition

From   Nick Cox <>
Subject   Re: st: deleting variables based on a certain condition
Date   Tue, 3 Apr 2012 18:54:32 +0100

-findname- was recently updated in SJ 12(1) 2012 and on SSC. That was
announced on this list in

and should be evident from -search findname- in an up-to-date Stata
12. You need to look at the archives and also to update your copy of

Here is a way to do it with -findname-. No "addition" is needed.

sysuse auto, clear
gen FOO = 42

findname, all(regexm("@", "[A-Z]+")) local(SHOUTED)

drop `SHOUTED'

The local macro -SHOUTED- consists of names that you want.

That's a bit of an awkward way to do it, but still a way to do it.


On Tue, Apr 3, 2012 at 6:32 PM, Abhimanyu Arora
<> wrote:
> Dear statalist and Nick
> I have certain variables the names of which are in capitals. I would
> like to delete them altogether.
> Basically I am looking for a something in addition to what SSC's
> findname by Nick Cox does. Perhaps Nick has a newer version or somehow
> this one can suffice?
> . which findname
> c:\ado\plus\f\findname.ado
> *! 1.0.1 NJC 28 April 2010
> *! 1.0.0 NJC 30 March 2010
*   For searches and help try:

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