A possible solution is offered by the -eclplot- package, (downloadable
from SSC), which has a -supby()- option to allow superimposed confidence
interval plots. The -supby()- option has suboptions -spaceby- and
-offset-, allowing the user to space the different superimposed plots so
the confidence intervals do not overwrite each other and cause
confusion. -eclplot- also offers many types of confidence interval plot,
using the -eplottype()- option and the -rplottype()- option to define 7
ways of plotting estimates and 8 ways of plotting confidence limits,
which can be combined to give 7*8=56 possible combinations. The most
popular combinations are probably the default -eplottype(scatter)
rplottype(rcap)- (whic gives conventional CI plots with a symbol and a
whisker) and the alternative -eplottype(bar) rplottype(rcap)- (which
gives detonator plots).
I hope this helps.
Roger
Roger Newson
Lecturer in Medical Statistics
EMAIL: r.newson@imperial.ac.uk
WEBSITE: http://www.imperial.ac.uk/nhli/r.newson/
TELEPHONE: +44 (0)20 7352 8121 ext 3381
FAX: +44 (0)20 7351 8322
ADDRESS:
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute at Imperial College London
Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
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 Joseph
Coveney
Sent: 10 July 2006 09:21
To: Statalist
Subject: st: What is the best way to graph CI bands that partially
overlap?
Plotting the confidence interval as a tinted band around the prediction
line
seems to be a good way to present the model fit, and that is what
-lfitci-
does. A problem arises when plotting two categories' or groups' model
fits
on the same graph. Wherever the CI bands overlap, the CI band of the
last
fit plotted will obscure the earlier one's.
Using -twoway rline- is an alternative, but it gives rise to a graph
with
six lines for two treatment groups (two prediction lines and two sets
each
of upper and lower confidence limit lines). Even with softening of the
CL
lines (reduced intensity, line thickness, etc.), the graph looks crowded
and
requires more audience effort.
One approach I've seen recently is to separately plot the overlapping
regions in a mixed color. Say, the CI band of the first plot is blue
and
that of the second is red, then the overlapping region is plotted in
purple.
I cannot recall where I saw the example of this approach, but it seems
doable in Stata, using indicator variables for flagging when the lower
CL of
one fit is less than the upper CL of the other, and then overlaying
a -twoway rarea ucl1 lcl2 x if flag-, or something similar. It seems
cumbersome, though, and flagging could get complicated if the
predictions
cross, such as with an interaction.
I suppose that another alternative for categorical predictors would be
to
use a connected-symbols or bars for the predictions with an overlaid
range-spike-with-cap for the CI. This, too, would seem to make for an
overly busy graph if there are more than just a couple of categories in
the
predictor, and doesn't seem ideal if the categories are samplings of an
underlying predictor that is inherently continuous (time, drug
concentration).
Is there a consensus, or even a plurality, of opinion how best to depict
model fits including CIs when there is some overlapping of the CIs?
Joseph Coveney
*
* 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/