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

Re: st: changing the order of graph by?


From   Roger Newson <[email protected]>
To   [email protected]
Subject   Re: st: changing the order of graph by?
Date   Thu, 19 Aug 2004 16:48:28 +0100

At 15:53 19/08/2004, Jannik Helweg wrote:
Is it possible to change the order of the graph by_option, e.g  the sequence
of left to right of a repeated graph, in which the by variable is a string
variable ?

I am using Stata 8.2, latest update and been unable to find the answer in
the manual.

Example:

sysuse nlsw88, clear
graph hbar wage, over(occ, sort(1)) by( union)

Now nonunion is shown left and union shown right- Is it possible to reverse
this order to union left and nonunion right?
I would use the official Stata -encode-, or possibly my own -sencode- (downloadable from SSC), to code your string variable to a labelled numeric variable in the order you want. Then use the numeric variable with the graphics -by()- option.

Roger


--
Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605
Email: [email protected]
Website: http://www.kcl-phs.org.uk/rogernewson

Opinions expressed are those of the author, not the institution.

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