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

Re: st: RE: RE: RE: RE: Double -for- loop on one line crashes Stata

From   Roger Newson <>
Subject   Re: st: RE: RE: RE: RE: Double -for- loop on one line crashes Stata
Date   Tue, 15 Oct 2002 20:38:53 +0100

At 19:58 15/10/02 +0100, Nick Cox wrote:

Well, we really need a Stata Corp input on this one.

Loosely, the more strain you put on the parser,
the greater the risk that Stata will misunderstand,
but that's just rephrasing my earlier comment
without adding any substance.

Stata sometimes to behave as if braces were another
kind of end-of-line delimiter, but not always.

Also, although the above works fine, I think you'll
see, if you look at documentation, that it is not encouraged
anywhere, even by example.
A possible counterexample to Nick's proposition can be found in the Stata 7 hardcopy manuals under -[P] if- (Page 121 of the Programming manual). This contains an in-line phrase

if age>21{summarize age}

(without even semicolons). However, in that context, it might be argued that the manual is not explicitly encouraging people to use this construct. (For what it's worth, this phrase executes without error in the -cancer- data shipped with official Stata.)


Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605

Opinions expressed are those of the author, not the institution.

* For searches and help try:

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