[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Re: Programming style for multiple AND and OR constructs
inlist() and inrange() may be what you are looking for
----- Original Message -----
From: "David Winter" <firstname.lastname@example.org>
Sent: Wednesday, May 31, 2006 5:54 AM
Subject: st: Programming style for multiple AND and OR constructs
I am writing a Stata program to aggregate classifications based on a
cancer TYPE and SITE. I am converting the code from SPSS so it is
syntactically rather inefficient, for example:
DO IF (TYPE = n OR TYPE = n2 OR TYPE = .... etc (further 5 iterations)).
COMPUTE group = 1
ELSE IF (TYPE = n AND TYPE = n2 AND TYPE = .....) etc.
COMPUTE group = 2
To make this a bit easier SPSS has a function: ANY(TYPE,n1,n2,n3). Does
Stata has a similar function? I see there are functions -anyof()- and
-allof() but they appear to have a different function.
* For searches and help try: