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   Buzz Burhans <>
Subject   RE: st: RE: Error Bars on Histogram or Bar Plots
Date   Mon, 02 Jun 2003 11:21:59 -0400

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.
One of the nicer thngs about Stata in general is that there are often multiple ways to "skin the cat' so to speak, i.e. there are often alternative ways to do something. Graphing data may be a case in point. While using a collapse may work in some instances, there are certainly alternatives, and the alternatives can allow easier implemetnation of error bars. (maybe even alternative "collapses", I haven't thought about or looked at the possibilities). XTGRAPH is a case in point. I don;t think this capability is all that unusual or difficult to implement, though it might in some instances require a second approach to some graph types. It is absolutely, however, doable.

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.
"Wrong" from the standpoint of authors instructions in the specific case I was reflecting on. I have panel data repeated in time, for which XTGRAPH works nicely, except for the error bars, which overlay the empty symbols. In essence, using XTGRAPH and the half option, the error bar "marker" at the line end where the datapoint is plotted overlies the datapoint symbol, which, if it is an open symbol, means the point ends up to be a marker within a marker. The authors instructions for the journal specify that should not occur. Could I get away with it? Maybe. Do other graphics routinely published in that journal adhere to the instructions? Yes. Does the instruction make reasonable sense in terms of clarity of the graphics? Yes. I don't think it is an unreasonable recommendation, and using other software I can adhere to it. But, I like keeping my work in Stata for several reasons, and I think I should be able to do a better job with this in Stata. As it was, I went to Stata8 (XTGRAPH is a version 7 command), and reconstructed this so I could have better control over the markers. It works, but at a considerable investment of time to get error bars into the plots.

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
Yes, I am referring to biological sciences literature. I am not sure whether what you have depicted is what I am referring to or not. If it is, I would have to say the reaction of the users group was unfortunate, because the represention of error bars is common, in fact standard, in many instances. There are many mainstream biological sciences journals that use similar graphic representation of error terms. It is so mainstream I question the need to argue about it or defend it. It is an integral part of representing much data that is published. And while your example represent one use, such bars are also important in interpreting connected line plots as well.

I encourage Stata Corp to correct what is, in my opinion, a substantive deficiency in their fine graphics capabilities. In doing so, I would again refer them to XTGRAPH as an excellent example of related functional concerns, as I outlined previously(flexibility, integration with models, etc.). There are other user written plots that construct error bars, I know, and I assume these were also driven by some perceived need for error bars. I just don't think this is something that should be relegated to user written should be, in my opinion, a integral part of the graphical capability of Stata.

Bottom line, the representation by error bars is, in my opinion, an important, informative, and necessary component of graphical representation of data in many (obviously not all) cases. Any statistical graphics program that fails to accomodate this is deficient, again, my opinion.

I think, Nick, we are mostly in agreement.

Thanks for listening.

Buzz Burhans

* For searches and help try:

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