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

RE: st: multiple if??


From   Nick Cox <[email protected]>
To   [email protected]
Subject   RE: st: multiple if??
Date   Sun, 11 May 2003 20:05:06 +0100

-------------------
> you could use a single generate statement with nested "cond", e.g.,
> 	gen
>
dem1=cond(index==1,demand1,cond(index==2,demand2,cond(index==3,demand3
...

You _could_ do this. I suggest that this is much more difficult 
to type and to get right than almost any alternative. I know 
all you need do, in principle, is just to match parentheses. ..

Nick
[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