Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: RE: constructing the rank across variables
From
Nick Cox <[email protected]>
To
"'[email protected]'" <[email protected]>
Subject
st: RE: constructing the rank across variables
Date
Thu, 7 Oct 2010 19:47:47 +0100
-egen- is in principle wrong here as it produces a single result variable. I suppose that does not rule out repeated calls to -egen-, but I think it is better in principle to think of a dedicated command that does this all at once.
Already twice today I have referred to a review of this territory
SJ-9-1 pr0046 . . . . . . . . . . . . . . . . . . . Speaking Stata: Rowwise
(help rowsort, rowranks if installed) . . . . . . . . . . . N. J. Cox
Q1/09 SJ 9(1):137--157
shows how to exploit functions, egen functions, and Mata
for working rowwise; rowsort and rowranks are introduced
Sorry for the repetition, but Jon perhaps did not pay attention to those threads, life being short and people being busy, and so forth.
In any case, the brief abstract of the abstract above shows that a -rowranks- command already exists.
Nick
[email protected]
Jon Schwabish
Could anyone recommend a way to create a series of variables that indicate the
rank of a list of variables in a wide-format data set, akin to using the 'egen
rank' function in a long-format data set? That is, how would one code up 'egen
rowrank'?
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/