[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: re: WHILE command

From   Kit Baum <>
Subject   st: re: WHILE command
Date   Mon, 17 Mar 2008 15:26:46 -0400

Nick W said

How does one do this in cases where one cannot calculate, in advance,
the number of repetitions needed, or the list of items to be acted upon?

As Nick C has pointed out, nothing stops you from using a forvalues loop over a large number of values and testing within the loop to determine whether some condition is now satisfied (e.g., if the norm of the gradient is now less than epsilon), and using

continue, break

to terminate the loop at that point.

Kit Baum, Boston College Economics and DIW Berlin
An Introduction to Modern Econometrics Using Stata:

* For searches and help try:

© Copyright 1996–2019 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index