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

Re: st: max value

From   David Kantor <>
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 Kantor
Institute for Policy Studies
Johns Hopkins University

* For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index