[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: RE: inner loop
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
There have been several threads touching on this
over the last few months on Statalist.
In essence, nested -for- sometimes works, but
it is not guaranteed to work.
I don't understand this example, but -forvalues-
and -foreach- nest very well and are strongly
recommended for nested problems.
There is a tutorial in Stata Journal 2(2), 202-222 (2002);
if you do not have access to SJ, the substance of that is
accessible at http://www.stata.com/support/meeting/8uk/fortitude.pdf
* For searches and help try: