It seems so.
Stata sorts strings as a dictionary would, except for the order of its
alphabet.
If you want to sort strings on their numeric content, create a sort key
variable with just that numeric content. In simple cases, -destring-
will suffice, but with attention to its options.
Nick
[email protected]
sdm1
I was thinking about sorting strings in the same way as one would sort
numerics so that, for example, a four digit integer is always greater
than a
three digit integer. Clearly I shouldn't think like this when it comes
to
strings because "N12 " is less than "N13" and, although 1234 is greater
than
124, "1234" is less than "124". When thinking about the sort order of
strings, would it be sensible to think of them being left aligned
(whereas
with integers they're right aligned)?
*
* 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/