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

*   For searches and help try:

© Copyright 1996–2022 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index