Statalist The Stata Listserver

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

st: RE: multiple barplots wih CIs

From   "Thuy Le" <>
To   <>
Subject   st: RE: multiple barplots wih CIs
Date   Tue, 06 Jun 2006 01:08:57 -0400


I think your problem is that rate1 and rate2 may have similar range of
values so they overlapped when both are plotted against groupvar.

One solution is to change the scale of rate1 or rate2 then they can share
the same x-axis. The other solution is to plot to separate graphs, saving
them and combine them side-by-side.

I am sorry for being more specific since I am not really clear about what
you want.


-----Original Message-----
[] On Behalf Of Daniel Exeter
Sent: Tuesday, June 06, 2006 12:27 AM
Subject: st: multiple barplots wih CIs

Hi folks, 

I've seen earlier listings that demonstrate how to use the twoway option to
graph CIs upon a barchart for 1 variable, but it all goes pearshaped when I
try to do the same approach with a second bar/CI combination - the bars for
the first variable are wide (all bars touching) and the bars for the second
variable are superimposed upon these, and are narrow.

Incidently, the syntax below also fails to show the lower confidence value
on the plot. If I flip the order of the rcap and bar statements in the
syntax below, I get an 'invalid syntax' error for the barwidth command.

Does anybody have any ideas on how to fix these errors, in V8.0 intercooled?


Lb = lower CI
Ub = upper CI
1 and 2 represent 2 separate time periods

graph twoway  rcap lb1 ub1 groupvar|| bar rate1 groupvar || rcap lb2 ub2
groupvar || bar rate2 groupvar,  xtitle("Group variables")
 xlabel(1(1)5) ylabel(0(25)100)
#d cr

*   For searches and help try:

*   For searches and help try:

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