Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: foreach
From 
 
Richard Goldstein <[email protected]> 
To 
 
[email protected] 
Subject 
 
Re: st: foreach 
Date 
 
Tue, 29 Jun 2010 08:50:56 -0400 
"saba" and "laba" are, apparently, not variable names so this is not a
varlist; try -foreach XX in saba laba {-
Rich
On 6/29/10 8:44 AM, Tomas Lind wrote:
> Dear all,
> 
> I have a lot of variables ending up with _L or _B (for example saba_B,
> saba_L, laba_B, laba_L)
> 
> If I simplify my problem I would like to do the following
> 
> foreach  XX  of varlist   saba  laba  {
> tab `XX'_B   if `XX'_L != .
> }
> 
> But it doesn't work.
> 
> Does anyone have an idea how to fix this?
> 
> 
> /Tomas
*
*   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/