Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Creating a variable with the highest value from two other


From   "Joseph Coveney" <jcoveney@bigplanet.com>
To   "Statalist" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Creating a variable with the highest value from two other
Date   Sat, 13 Oct 2007 17:33:45 -0700

The nested -cond()- example was missing parts:

generate long Z = cond(missing(X), cond(missing(Y), ///
 ., Y), cond(missing(Y), X, cond((X>=Y), X, Y)))

-egen-'s going to be easier and prettier than that, though maybe slower.

Joseph Coveney


*
*   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