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

RE: st: Transformations


From   "Nick Cox" <[email protected]>
To   <[email protected]>
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 
[email protected] 

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