Statalist The Stata Listserver


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

Re: st: What is the best way to graph CI bands that partially overlap?


From   Joseph Coveney <[email protected]>
To   Statalist <[email protected]>
Subject   Re: st: What is the best way to graph CI bands that partially overlap?
Date   Mon, 02 Oct 2006 12:34:56 +0900

I wrote (in July):

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. [snip]

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 [snip]

--------------------------------------------------------------------------------

For anyone interested, Adrian Mander has written a command -drarea- that
handles this nicely. According to its description on SSC, it "allows two
range area plots to be overlapped in an intelligent way. At the moment Stata
does not allow a level of transparency in the graphics engine and adopts a
'last drawn first seen' rule. This command actually averages the colours in
the overlapping area to give the illusion of transparency."

Examples of using this technique to good effect in survival plots can be
seen on Page 5 of http://www2.sas.com/proceedings/sugi31/095-31.pdf , which
is very likely where I had run across it.

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/



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