Lukas,
See -help capture-. You can also add an -if- statement at the
beginning of the loop that checks if the current model can be
estimated.
forvalues i = 1(1)5000 {
* Move to next regression if condition is true
if [condition, e.g. sample size too small] {
continue
}
[other commands]
}
Friedrich
--- Lukas Mohler <[email protected]> wrote:
> Dear Statalisters,
>
> I'm running several thousand regressions within a forvalues loop.
> It goes like
> this:
>
> forvalues 1(1)5000{
>
> ivreg2 ..... if selection==x_1, gmm robust
>
> x_1=x_1+1
>
> estout .....
>
> }
>
> For some values of selection I do not have enough observations to
> estimate the
> model. Also, other problems could arise with the data.
>
> This is why I'd like to suppress all possible error messages and
> continue to loop through my regressions.
>
> Thanks!
>
> ---
> Lukas Mohler
> Abteilung Aussenwirtschaft und Europ�ische Integration
> Wirtschaftswissenschaftliches Zentrum
> Universit�t Basel
> Petersgraben 51
> 4003 Basel
> Switzerland
> +41 61 267 07 70
> ---
____________________________________________________________________________________
8:00? 8:25? 8:40? Find a flick in no time
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news
*
* 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/