use -sencode-
ssc install sencode
for example:
sysuse auto
encode make, gen(amaker)
sencode maker, gen(zmaker) gsort(- make)
table maker, c(m amaker m zmaker)
> > 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.
*
* 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/