Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: AW: st: RE: sort on month


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   AW: AW: st: RE: sort on month
Date   Tue, 8 Sep 2009 17:10:44 +0200

<> 

"Arbitrary" may be too strong a word, but if you run the code accompanying
my post, you will see that the command does not take qing where he wants to
go. It assigns the numeric "1" to the string "1" and "2" to the string "10"
and so on. So it evidently is not a promising candidate for the solution
here, as a sort on the newly generated variable will show you...



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Nick Cox
Gesendet: Dienstag, 8. September 2009 17:07
An: statalist@hsphsun2.harvard.edu
Betreff: RE: AW: st: RE: sort on month

David is quite correct, as far as the default of -encode- is concerned. 

The most puzzling question not yet answered is why -destring- would not
oblige in this case. I think the questioner has some bad stuff lurking
in their data. 

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

David Kantor

At 09:35 AM 9/8/2009, Martin Weiss wrote:

>-encode- is the wrong tool, as it assigns numeric codes arbitrarily.
[...]

I believe it is not arbitrary. It works, apparently (in Stata 10), on 
alphabetic order, which would yield the same result as the string
version.


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


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index