Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: -rowsort- updated on SSC


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: -rowsort- updated on SSC
Date   Wed, 23 Nov 2005 00:31:01 -0000

Thanks to Kit Baum, a revised version of -rowsort- 
is now available from SSC. 

Recently Alice Dobson posted a problem for which 
I recommended -rowsort- from SSC. Alice also 
pointed out that in a problem such as hers in 
which missing values are present -rowsort- does 
not operate as desired. 

Suppose in a one observation (row) of a set of 
variables the values are 1 . 3 . 5 . 7. 

-rowsort- by default follows standard Stata 
rules and orders these 1 3 5 7 . . . and with
a -descend- option it orders them . . . 7 5 3 1. 

The latter then makes it difficult to read off
largest, second largest, and so forth, as might 
often be wished. 

An easy work-around is to hit the variables 
concerned with -mvencode- and then adjust for what 
you did. 

However, as earlier indicated, I have now added 
an option that specifies that missings should be 
treated as some specified number when sorting is 
being done. Normally, but not necessarily, the 
user would specify a large negative integer lower
than the minimum in the data. It would be possible 
to do this automatically, but giving the user 
this handle adds some further control. 

-rowsort- has been revised at the same time and 
now requires Stata 8. (In some future revision 
using Mata for the sorting is to be considered.) 
The previous -rowsort- has now been renamed -rowsort6-
and will work with Stata 6 or 7, but it has not 
otherwise been changed (i.e. it does not have this 
new option). 

Thanks to Alice for her interesting problem. 

Nick 
n.j.cox@durham.ac.uk 


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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   |   What's new   |   Site index