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

st: Re: if statements with multiple values


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   st: Re: if statements with multiple values
Date   Sat, 10 Jan 2004 15:13:43 -0500

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/



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