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

st: -fixsort- available from SSC


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsph.harvard.edu>
Subject   st: -fixsort- available from SSC
Date   Wed, 3 Aug 2005 23:49:16 +0100

Thanks to Kit Baum, a -fixsort- package has been 
added to SSC. Stata 9 is required. 

Florence Neymotin posted a question on 28 June on 
sorting and in response I posted a program -cosort-, 
previously posted on the list at least once but never 
archived anywhere. 

After some thought -- and indeed wanting this 
recently for my own purposes -- I have produced
a new program -fixsort- with similar but not identical 
aims. The help file gives some detailed explanations 
and examples, including some warnings. 

-fixsort- sorts each variable specified and places 
variables so that all are in sorted order, aligned so 
that the first value of each is in the first observation, 
the second value of each is in the second observation, 
and so on.  By default the variables so placed are the 
variables specified; with the -generate()- option they 
are new variables containing copies of those variables. 
Other variables retain their current sort order.  
Variables may be numeric or string.

Note that -fixsort- is a rarely needed command. Almost 
all sorting problems call for -sort- or -gsort-. Also, 
-fixsort- destroys information in your data set in so far 
as values in each observation are typically not kept together. 

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