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

st: if statements with multiple values


From   "F. Michael Kunz" <[email protected]>
To   [email protected]
Subject   st: if statements with multiple values
Date   Sat, 10 Jan 2004 15:03:38 -0500

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

PH (843) 792-4225
FAX (843) 792-1358

E-mail: [email protected]
=========================================================

*
* 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