Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: inner loop


From   "Hans J. Baumgartner" <[email protected]>
To   [email protected]
Subject   Re: st: RE: inner loop
Date   Wed, 06 Nov 2002 09:10:33 +0100

Thanks James,

defining the IDs the nested for runs fine now.  

Hans

PS
The replace command picks one var out of a bunch of vars. I just dropped
the ifs for simplicity.  

James Jetton schrieb:
> 
> Hans J. Baumgartner
> >
> >  is it possible to run an inner loop using the for command?
> >  I think it is
> >  not possible but could someone point me to a command that allows for
> >  such an inner loop?
> >
> >  What I would like to do is basically the following:
> >
> >  for any a b c: for num 1984/2000: replace z=YX
> 
> Nested for loops often fail if the ids are not explicitly specified.
> For example
> 
> for any a b c: for num 1984/2000:
> 
> will fail but
> 
> for X in any a b c: for Y in num 1984/2000:
> 
> will work.
> 
> This appears to be a bug in the for ado. Been bitten by this
> hemipteran more than once.
> 
> Although I'm not sure what you are trying to do with "replace z=YX".
> 
> James Jetton
> [email protected]
> *
> *   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/

-- 
Hans J. Baumgartner 
Deutsches Institut f�r Wirtschaftsforschung (DIW Berlin)
German Institute for Economic Research
Abt. Staat / Dept. Public Sector
K�nigin-Luise-Str. 5; 14195 Berlin (Dahlem) 
Tel.: 030/89789-307; Fax.: 030/89789-114
http://www.diw.de
*
*   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