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" <[email protected]>
To   "Statalist" <[email protected]>
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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index