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

Re: st: encode


From   Ron�n Conroy <[email protected]>
To   [email protected]
Subject   Re: st: encode
Date   Thu, 02 Dec 2004 17:33:29 +0000

David Airey wrote:


I can work around this question manually, but encode works in ascending
alphabetical order...is there a way to encode in descending
alphabetical order? This is because I want descending order using the
by_option of my graph command.


General solution: define a value label first and force -encode- to use it.

. lab def mysequence 0 "Zimmerman" 1 "Xenakis" 2 "Weill",modify
. encode composer, gen(Composer) lab(mysequence)

This is pretty tedious if you have a lot of categories, though.

--

Ronan M Conroy ([email protected]) Senior Lecturer in Biostatistics Royal College of Surgeons Dublin 2, Ireland +353 1 402 2431 (fax 2764) -------------------- Just say no to drug reps http://www.nofreelunch.org/

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