Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: deleting variables based on a certain condition


From   Abhimanyu Arora <[email protected]>
To   [email protected]
Subject   Re: st: deleting variables based on a certain condition
Date   Tue, 3 Apr 2012 20:30:54 +0200

Thanks a lot, Nick, very enlightening.
Best regards
Abhimanyu

On Tue, Apr 3, 2012 at 7:54 PM, Nick Cox <[email protected]> wrote:
> -findname- was recently updated in SJ 12(1) 2012 and on SSC. That was
> announced on this list in
>
> http://www.stata.com/statalist/archive/2012-03/msg00597.html
>
> 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
> -findname-.
>
> 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)
> FOO
>
> 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.
>
> Nick
>
> On Tue, Apr 3, 2012 at 6:32 PM, Abhimanyu Arora
> <[email protected]> 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:
> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index