if inlist(varname,1,2,3,...)
Michael Blasnik
[email protected]
----- Original Message -----
From: "F. Michael Kunz" <[email protected]>
To: <[email protected]>
Sent: Saturday, January 10, 2004 3:03 PM
Subject: st: if statements with multiple values
> Dear statalisters:
>
> I have tried using the following construction with if statements
>
> . if varname == (1 | 2 | 3 ...)
>
> But instead find that I must use
>
> . if (varname == 1) | ( varname==2) | (varname==3)...
>
> Which is more cumbersome.
>
> Can anyone think of a better way to do this?
>
> Thanks !
>
> --
> =========================================================
> F. Michael Kunz, M.A.
> Senior Research Associate
> Center for Health Economic and Policy Studies
>
> Medical University of South Carolina
> Department of Health Administration and Policy
> 19 Hagood Avenue, 408 Harborview Tower
> P.O. Box 250807
> Charleston, South Carolina 29425
>
*
* 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/