Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: if


From   Bulent Koksal <bkoksal@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: if
Date   Tue, 18 Oct 2011 11:32:01 +0300

Dear Stata Users,

   In SAS I can write a command like

if bankid in (2,25,46,76) then newvar=1; else newvar=0;

How can I do this in Stata? I don't want to keep writing  bankid ==2 |
bankid==25 etc.

any easy way of doing this? Thank for any help.

--
Bülent Köksal

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index