Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: sorting rows with a "key"


From   "Ashim Kapoor" <[email protected]>
To   [email protected]
Subject   st: sorting rows with a "key"
Date   Wed, 10 Sep 2008 11:31:42 +0530

Hello everyone,

I have a small question. I really liked the program "sortrows" . I
wish to ask if anyone has written a similar program for sorting with a
"key".

I mean the following.:=

say I have 4 variables ( in my case I have around a 100 so I cannot
possibly do it in the usual manual bubble sort because it takes
forever)

say a1 a2 key1 key2

I want to say sortrows ( key1 key2)  which will do the usual sortrows
BUT it will also sort the a1 and a2 in the same order ie. if k1 < k2
then a1 < a2 for that row.

Any tips ? Any program which already does this ?

Thank you,
Ashim.
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index