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 variables


From   "Joseph Coveney" <[email protected]>
To   "Statalist" <[email protected]>
Subject   RE: st: Creating a variable with the highest value from two other variables
Date   Mon, 15 Oct 2007 12:09:55 -0700

Nick Cox wrote:

gen Z = max(X, Y)

is even simpler.

--------------------------------------------------------------------------------

The List is great for dispelling id�es fixes:  for some reason, I had got it
into my head a long time ago that -max()- doesn't work for variables
(probably attempted to use ranges of variables as the argument at one time
or another), and had never bothered to consider the function again in such a
context.

Thanks, Nick.

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