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: a reverse wildcard or other way to mean "all variables but..."


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: a reverse wildcard or other way to mean "all variables but..."
Date   Fri, 29 Jun 2012 17:12:46 +0100

ds ID, not

collapse `r(varlist)', by(ID)

or use -findname- (SJ, SSC)  to the same effect.

Nick


On Fri, Jun 29, 2012 at 4:56 PM, Doug Hess <[email protected]> wrote:
> I thought I was being smart and quick with the following one-liner
>
> -collapse *, by(ID)-
>
> But, of course, the variable named ID is included in the wildcard
> before the comma, which means the command gives the error statement
> "control may not be both target and by()." I'm not sure if the
> solution is some reverse of the wildcard or way to say: _all "but
> don't include ID when I say _all".   I guess one can just include all
> the variables in a - local - or -global- and then hunt for and remove
> the one variable you want left out. But is there a code for
> subtracting something from * or _all on the fly, so to speak?
>
> Thank you. I'm on the list in digest mode, so if replies can cc me,
> that would helpful.
>
> [P.S. I found this discussion in the archive, but it's not exactly the
> same issue: http://www.stata.com/statalist/archive/2008-10/msg00507.html
> ]

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