[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: maximum of a list of values
At 11:01 AM 6/28/2005 -0700, Florence wrote:
also, one more question:
If I want to get the maximum of the first entry of a bunch of entries,
then is there a way to do this in shorthand? i.e. suppose I want the
maximum of x1[1,1], x2[1,1], x3[1,1], x4[1,1], x5[1,1], x6[1,1], x7[1,1]
x8[1,1], then I thought it was possible to
write: max(x1[1,1],...,x8[1,1]) but this isn't giving me all of the
values in between.
is not a legitimate expression; I get an error message when I present it
(in Stata 8.2).
(But max(x1[1,1],.,x8[1,1]), with only one dot, is legitimate; the dot is a
missing value, and is ignored.)
But did you mean that expression literally, or did you mean the
max(x1[1,1], x2[1,1], x3[1,1], x4[1,1], x5[1,1], x6[1,1], x7[1,1], x8[1,1])
The latter ought to work out fine.
I'm not aware of any shorthand for this, though perhaps someone else can
suggest something. If the problem is that you don't want an expression
that uses a hard-coded set of matrix names, then you can set up some kind
of loop to get your result.
Institute for Policy Studies
Johns Hopkins University
* For searches and help try: