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

From   Nick Cox <>
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.


On Fri, Jun 29, 2012 at 4:56 PM, Doug Hess <> 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:
> ]

*   For searches and help try:

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