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

RE: st: Transformations

From   "Nick Cox" <>
To   <>
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 

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. 


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:

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