Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Sort order in graph box, over() by()


From   "Svend Juul" <SJ@SOCI.AU.DK>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Sort order in graph box, over() by()
Date   Tue, 28 Aug 2007 17:54:45 +0200

Stefan Kreisel wrote:
 
Is there a way to individually sort the order of boxes
in a given subgraph as produced by the by() option in
e.g. -graph box yvar, over(xvar, sort(1)) by(anothergroup)-?
 
The problem is that missing categories on a given subgrouping
of by() get put on the far right most side of the subgraph;
I want them all in the same position in each subgraph.
 
-----------------------------------------------------------
 
Scott and Nick had suggestions. But I believe that Stefan
wanted to use the original "natural" sequence of categories.
Here is a simple modification of Scott's suggestion:
 
sysuse auto, clear
set obs 76
replace foreign = 1 in 75/76
replace rep78 = 1 in 75
replace rep78 = 2 in 76
graph box mpg, over(rep78, sort(rep78)) by(foreign)
 
 
Svend
 
 
________________________________________________________ 
 
Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6 
DK-8000 Aarhus C,  Denmark 
Phone, work:  +45 8942 6090 
Phone, home:  +45 8693 7796 
Fax:          +45 8613 1580 
E-mail:       sj@soci.au.dk 
_________________________________________________________ 

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