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

st: data loop question

From   "Bauldry, Shawn" <[email protected]>
To   <[email protected]>
Subject   st: data loop question
Date   Wed, 11 May 2005 14:44:00 -0400


I have a series of variables, say x1-x10, and I would like to determine
the numeric suffix associated with the variable that has the maximum
value for each case.  For example, maybe x9 has the max for case 1 and
x7 has the max for case 2, then I would like to end up with a variable,
say MaxX, that has a 9 and 7 for the first two cases respectively.  I
think a data loop is the way to go, but I've tried working out a loop to
do this and it's not coming to me.


*   For searches and help try:

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