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: foreach


From   "Tomas Lind" <tomas.lind@ki.se>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: foreach
Date   Tue, 29 Jun 2010 14:44:04 +0200

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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index