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

RE: st: RE: Error Bars on Histogram or Bar Plots


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: Error Bars on Histogram or Bar Plots
Date   Mon, 2 Jun 2003 14:04:30 +0100

Buzz Burhans
 
> > > How do you put error bars on histograms or bar plots? I am
> > > using Stata 8 in Windows.
> >
> >I don't think either is supported as a standard option.
> 
> I believe these were the posts that generated a great deal 
> of consideration 
> over the last week regarding sliding bins  for histograms, 
> histograms vs 
> bar graphs, and  the role of visual data exploration.
> 
> Having just spent a fair bit of time plotting some data for 
> publication 
> this weekend, I'd like to return to the original question 
> regarding error 
> bars. I have been using Stata 8, and I like the graphics.  
> It seems though, 
> that there is something fundamentally wrong with a 
> statistics graphing 
> program that doesn't facilitate the use of error bars on 
> plots, whether 
> connected  line plots or bar graphs.  Error or uncertainty 
> is a major 
> element of what we often wish or need to represent in a graphical 
> representation of data.  Stata makes one cob up solutions 
> for this when it 
> should be facilitating them. Yes, one can get it done, but 
> not always 
> easily or correctly for that matter.  For 
> instance,overlaying a range plot 
> works, but I don't think one should have to have a marker 
> on both ends of 
> the "error bar", and I don't think that if the plotting 
> symbols of the data 
> are open symbols, the error bar should more than touch the 
> edge...in fact 
> there are journals that specifiy that there should not be 
> markers in markers.
> 
> One of the best implementations of error bars in Stata has 
> been Paul Seed's 
> XTGRAPH; it is a nice implementation for a number of 
> reasons: 1)It is built 
> in to the process of plotting the data; 2) it allows a 
> great deal of 
> flexibility in the selection of the type of error one wants 
> to represent; 
> 3) It facilitates picking up and plotting the error terms 
> from a previously 
> run model 4) it facilitates visual issues by allowing half 
> error bars or 
> offsetting the plotted points.
> 
> It has some challanges for those of us who want to use it 
> without hacking 
> the code...it is not easy to control the symbol types, and 
> the error bars 
> come inside open symbols with their marker ends, but it is 
> a really nice 
> tool.
> 
> In any case, it is a nice example of a set of features that 
> I think Stata 
> should be more concerned about implementing.  The issue of 
> error terms 
> seems fundamentally a part of what statisitics is about, 
> and to have a 
> powerful graphics package that essentially ignores the need 
> to represent 
> that element ( I recognize there is some implemention made 
> vis a vis the CI 
> plots).  In the journals I read, error bars are commonly 
> used, and it seems 
> to me implementation of adding them to graphs easily and 
> flexibly is an 
> important feature that Stata Corp. should address.  It 
> should be as easy to 
> add error bars to bar graphs, as the original post 
> requested, and to other 
> graph types as well (twoway connect for example)

Let me try to divide this up into a 
variety of general and specific issues. As 
usual, discussion can range reasonably from 
the Stata-linked (how do you do X in Stata?) 
to the Stata-free (is X a good idea?). 

1. Stata should support error bars on graphs 
============================================

I agree with this. What's more, I don't think 
it's at all controversial. The only issue that 
is how it is supported. It so happens that 
Stata's been a bit laggard on producing  
wrapper commands for plots showing error bars. 
I doubt there's any policy there. 

However, having implemented various high- 
level commands in one way does inhibit twisting 
them in a different direction. -graph bar- 
for example is basically built around a -collapse- 
of the data. Building something else major on top of 
that, such as machinery for adding confidence 
intervals generally, would be, I guess, rather tricky. 

2. Specific problems experienced by Buzz 
========================================

Buzz: could you revisit this with concrete 
examples of what you typed and what is 
wrong or unsatisfactory about it? I may 
not be the only one to be unclear about precisely  
what syntax you are using. It is difficult, possibly 
even for the graphics experts at Stata, to know 
what you're missing which is there in Stata and 
what you're missing which is not. 

3. How error bars should be shown
=================================

I think there's a wider issue here about one 
kind of graph which I think Buzz has in mind. 
My impression is that it is very common 
in some (biological?) sciences but much less so 
in mainstream statistical literature. This 
graph shows magnitudes by thick bars with 
bases at 0 and errors by thin bars centred
at the top of the bar, schematically 
multiples of 
     _
     |
     | 
    XXX
    XXX
    XXX
    XXX 
    XXX 	
    XXX
    XXX
    XXX
  -------

A couple of years ago at a London 
users' meeting (the same) Paul Seed commented 
that you couldn't draw such graphs 
easily in Stata (I don't recall if he 
wanted to draw them himself). As soon 
as he had explained what they were 
the reaction from the normally fairly 
polite and fairly articulate audience 
was something like

"No, no." "Yukk." "Horrible!" 

My own rationale for disliking these graphs 
strongly is this:  

1. Their visual signal conflates two 
distinct issues, estimate relative to 
zero and estimate relative to error 
bar. 

2. Suppressing the bottom part of the 
error bar obliges the concerned user 
to guess mentally where it ends. That's 
very poor. 

3. Such graphs take a lot of ink to show 
relatively little information. 

Something like a dot chart seems to me 
far preferable. Cleveland's work is relevant here. 

Of course, there will be other views, and 
there are other issues here, not 
least the anthropological one of what is 
expected or instructed by editors and referees 
in particular fields. 

Nick 
[email protected] 

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