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

Re: st: max value


From   David Kantor <[email protected]>
To   [email protected]
Subject   Re: st: max value
Date   Tue, 08 Apr 2003 08:47:16 -0400

Ronnie Wrote:

Hi (stata8, win2k)
I have 3 variables p1 p2 p3. I need to generate a new variable pred

"pred" ==
1 if p1 is the largest of the 3,
2 if p2 is the largest
and 3 if p3 is the largest
[...]
This is not particularly difficult, but the problem, as stated is ambiguous. What do you want to happen if the maximal value occurs in more than one of the variables?

--David

David Kantor
Institute for Policy Studies
Johns Hopkins University
[email protected]
410-516-5404

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