Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: excluding variables from varlist


From   Thomas <[email protected]>
To   [email protected]
Subject   Re: st: excluding variables from varlist
Date   Wed, 24 May 2006 18:52:02 +0100

Thanks!

Phil Schumm wrote:
On May 24, 2006, at 12:35 PM, Phil Schumm wrote:
unab allvars: _all
loc vars_to_exclude "a b c"
foreach var in `:list allvars - vars_to_exclude' {
    ...
}

Better, of course, would be:


unab allvars: _all
unab vars_to_exclude: a b c
foreach var in `:list allvars - vars_to_exclude' {
...
}


so that the list of variables to exclude may be specified as a Stata varlist. That'll teach me to click "Send" without proofreading...


-- Phil

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/

--
______________________________
Thomas Triebs
Research Assistant
Electricity Policy Research Group
Faculty of Economics
University of Cambridge
Sidgwick Avenue, Austin Robinson Bldg.
Cambridge CB3 9DE
United Kingdom
Phone: +44-1223-335287
Fax: +44-1223-335299
http://www.econ.cam.ac.uk
http://www.electricitypolicy.org.uk

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index