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

RE: st: RE: Taking averages, etc.

From   Richard Williams <>
Subject   RE: st: RE: Taking averages, etc.
Date   Wed, 17 Dec 2003 08:52:53 -0500

At 01:30 PM 12/17/2003 +0000, Nick Cox wrote:
Let's not lose sight of where we started.
Stata has standard constructs

if ... {

else {


too; the point is that the conditional
testing cannot be vectorised.
Just so I'm clear as to what you mean: If I understand this correctly, if the statement is something like

if x1==1 {

and x1 = 1 for the FIRST case, then the statement is true, otherwise false; it won't matter what x1 = for the 2nd case. So, this kind of structure is not useful for case by case changes. It is useful for things like your earlier

if r(N) == 0 su mpg

where the value of r(N) (or whatever) is not going to change case by case. Sound right?

Richard Williams, Associate Professor
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: Richard.A.Williams.5@ND.Edu
WWW (personal):
WWW (department):

* For searches and help try:

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