[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: row number corresponding to a column maximum

From   Gabi Huiber <>
Subject   Re: st: row number corresponding to a column maximum
Date   Tue, 28 Jul 2009 19:47:59 -0400

Glenn is right, of course. And his one-liner is much nicer than my
concoction, with one change: in my notation, the i and j should be
swapped in the formula he proposes.

Example of usage:
drop _all
set varabbrev on
cluster averagelink flex speed strength, name(avglnk)
cluster stop avglnk, matrix(a)
di maxneighbor

Thank you,


On Tue, Jul 28, 2009 at 7:03 PM, Glenn
Goldsmith<> wrote:
> <>
> Kit wrote of Gabi's previous solution:
>> I can't see how that can work with colmax(A)[1,j] being hardcoded to look at only the first row of A.
> I wondered about this as well at first, but the parentheses mean that
> it's hardcoded to look at the first (and only) row of the rowvector
> returned by colmax()- rather than the first row of A, so it's not
> actually a problem.
> Best,
> Glenn.
> *
> *   For searches and help try:
> *
> *
> *

*   For searches and help try:

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