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

Re: st: RE: Finding max value and then replace w/ code


From   [email protected]
To   [email protected]
Subject   Re: st: RE: Finding max value and then replace w/ code
Date   Mon, 19 Jul 2004 08:04:58 -0500

----- Original Message -----
From: Tonya Cropper <[email protected]>
Date: Monday, July 19, 2004 7:40 am
Subject: st: RE: Finding max value and then replace w/ code

> Thanks a lot Scott for the suggestion.
> 
> You inverted the expression and true/false result in your cond 
> command.  But
> once I reversed it, it worked fine.
> 
> gen w = cond(1, max(d, l, u) == d,  cond(0, max(d,l,u) == l, .5)) 
> should be
> 
> gen w = cond(max(d, l, u) == d,  1, cond(max(d,l,u) == l, 0, .5))
> 

Yes - thanks.

-Scott


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