Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Re: foreach question


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: Re: foreach question
Date   Tue, 17 Feb 2009 23:13:45 +0100

<>

Omit the quotes, you do not want the contents of the -macro- but its name...

-foreach x of local all_surveys{-

HTH
Martin
_______________________
----- Original Message ----- From: "Rike" <[email protected]>
To: "statalist" <[email protected]>
Sent: Tuesday, February 17, 2009 11:08 PM
Subject: st: foreach question


Hi everyone,

can someone please tell me what's wrong with the code below? Thanks in advance.

local all_surveys survey1 survey2 survey3

foreach x of local `all_surveys'   {
use `x', clear
reg...
reg...
esttab...
eststo clear
}
*
*   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/


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