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, statalist.org is already up and running.


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

st: a reverse wildcard or other way to mean "all variables but..."


From   Doug Hess <douglasrhess@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: a reverse wildcard or other way to mean "all variables but..."
Date   Fri, 29 Jun 2012 11:56:42 -0400

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
]

Doug
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index