Statalist The Stata Listserver


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

st: Re: excluding variables from varlist


From   Doug Owens <dowens@welchcon.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Re: excluding variables from varlist
Date   Fri, 26 May 2006 10:26:23 -0400

Another solution I sometimes use is of the form:

sysuse auto, clear
foreach var of varlist _all {
   local vl = "`vl' `var'"
}

local exclude "trunk weight disp length mpg make"
local vl: list vl - exclude
di "`vl'"



local   

> Hi,
>
> using the foreach command I would like to exclude certain variables,
> e.g:
> "foreach var of varlist _all [/excluding a, b, c/]".
>
> Is that possible and if so how?
>
> Thanks,
>
> Thomas

-- 
Douglas Owens
Economist
Welch Consulting



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