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" <tl6775a@american.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: multiple barplots wih CIs
Date   Tue, 06 Jun 2006 01:08:57 -0400

Hi, 

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.

Thuy  

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Daniel Exeter
Sent: Tuesday, June 06, 2006 12:27 AM
To: statalist@hsphsun2.harvard.edu
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?

Cheers
Dan


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

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


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


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index