Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: RE: constructing the rank across variables


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
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 
n.j.cox@durham.ac.uk 

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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index