Statalist The Stata Listserver


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

st: RE: Graph titles and labels with by()


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Graph titles and labels with by()
Date   Thu, 10 May 2007 21:50:08 +0100

Not your question, but in most situations a reduction to four box plots 
is just throwing away a lot of detail that might 
be interesting or useful -- and would not be confusing if 
presented carefully. You might see much, much 
more on other plots. 

Box plots, in my not so humble opinion, are perhaps optimal 
for (say) 30 or 100 groups when you desperately need severe reduction
to see the wood for the trees -- but vastly overused for comparisons
with a very few groups (to say nothing of their over-use for 
single distributions). 

For just four groups, dot plots, strip plots, 
beam plots, quantile plots, whatever can show much, much more. 

John Tukey himself (Exploratory data analysis, Addison-Wesley, 
Reading, MA, 1977), who re-invented the box plot, used Rayleigh's 
original data (which led to the discovery of argon and a Nobel Prize) 
to show the limitations of box plots. This dataset is bimodal (which 
turns out to be the key point) but a box plot utterly obscures that. 

Nick 
[email protected] 

Thomas Masterson
 
> I'm running in to a problem producing the graph I want.
> Running two separate box plots and combining them gives
> me a graph with one title, but a lot of space taken up
> with category labels. Using the by() option seems like
> it should be the answer.
> Here's what I think is the right code:
> 
> . graph hbox lnw [fw=wgt], over(cat) by(group, noiy) title("Title")
> 
> here's what I get:
> 
> 	Title           Title
> 	group1		group2
>       |               |
> cat1 |  box     cat1 |  box
>       |               |
> cat2 |     box  cat1 |     box
>       |_________      |___________
> 	scale            scale
> 
> and here's what I want it to look like:
> 
> 		Title
> 	group1		group2
>       |               |
> cat1 |   box         |   box
>       |               |
> cat2 |      box      |      box
>       |___________    |____________
> 	scale            scale
> 
> Can anybody see what I'm doing wrong?
> I also tried the -noiyl- in the -by()-
> options, but got the same output.

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