Statalist The Stata Listserver


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

st: RE: RE: multiple barplots wih CIs


From   "Newson, Roger B" <r.newson@imperial.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: multiple barplots wih CIs
Date   Tue, 6 Jun 2006 11:38:32 +0100

A possible solution might involve the -eclplot- package, downloadable
from SSC using the -ssc- command. -eclplot- has a -supby()- option,
allowing the user to superimpose multiple bar charts with CI whiskers,
separating them by spacing on the X-axis.

I hope this helps.

Roger

Roger Newson
Lecturer in Medical Statistics
TELEPHONE: (+44) 020 7594 0939
FAX: (+44) 020 7594 0942
EMAIL: r.newson@imperial.ac.uk
WEBSITE: http://www.imperial.ac.uk/nhli/r.newson/
POSTAL ADDRESS:
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute at Imperial College London
St Mary's Campus
Norfolk Place
London W2 1PG
STREET ADDRESS:
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute at Imperial College London
47 Praed Street
Paddington
London W1 1NR

SOON moving again to:
Imperial college
Emmanual Kay Building
Manresa Road
London. SW3 6LR
Tel.: +44 (0) 207 352 8121
Opinions expressed are those of the author, not of the institution.


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Thuy Le
Sent: 06 June 2006 06:09
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: multiple barplots wih CIs

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/

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