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

st: RE: sorting order


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: sorting order
Date   Thu, 4 Nov 2004 15:06:57 -0000

Good point. In Stata 7 and 8 you can 
get there in one 

di "`: sortedby'" 

which shows nothing if Stata is unaware of
a sort order. 

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

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of Kit Baum
> Sent: 04 November 2004 15:05
> To: statalist@hsphsun2.harvard.edu
> Subject: st: sorting order
> 
> 
> Barbara asked
> And second, is there any command (e.g. assert) in order to check the 
> sort sequence and only in case of being unsorted sorts the data?
> 
> Nick Cox' reply indicated that unneeded sorts would not be performed. 
> But this part of her question remains, and it might be useful to know 
> how to do this:
> 
> . sort foreign rep78
> 
> . local sorted: sortedby
> 
> . di "`sorted'"
> foreign rep78
> 
> whelp extended_fcn for the gory details.
> 

*
*   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