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

RE: st: Transformations


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Transformations
Date   Thu, 12 Feb 2004 15:30:30 -0000

Agreed in this particular case. First, 
there is no need to create a new variable. 
Second, the -inlist()- syntax is neat and 
appropriate. 

But in much more complicated cases, -eqany()-'s 
ability to expand a numlist makes it easier to 
use, even where -inrange()- is also a competitor. 

Nick 
n.j.cox@durham.ac.uk 

chris wallace

> indeed.  much neater.
 
Michael Blasnik 

> > Instead of the egen eqany() command, a better (one line) 
> approach would be
> > to use the inlist function.
> > 
> > replace var1=1 if inlist(var2,1,3)

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index