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 <[email protected]>
To   [email protected]
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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index