Statalist The Stata Listserver


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

RE: st: Box plot-like graph with mean, 95 percent CI


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Box plot-like graph with mean, 95 percent CI
Date   Thu, 8 Mar 2007 12:12:03 -0000

See also -eclplot- (Roger Newson) or -ciplot- (mine) from SSC. 

Nick 
n.j.cox@durham.ac.uk 

Sebastian F. Büchte
 
> you can achieve what you describe through overlaying two graphs. You
> will need a graph of type -scatter- and a graph of type -spike-.
> 
> Let's say you dataset contains four variables:
> 
> mean_var  ->   variable holding the mean
> lcl_var   ->   variable holding the lower confidence limit
> ucl_var   ->   variable holding the upper confidence limit
> x_var     ->   some variable over which you want to graph the above
>                mentioned variables
> 
> The apppropiate -graph- command would then be:
> 
> twoway                                          ///
>      || scatter mean_var x_var, [options]       ///
>      || rspike lcl_var ucl_var x_var, [options]  ///
>      || , [overall options,eg, legendoptions]
> 
> This could of course also be written down differently,eg, just in line
> omitting the "||" and the "///", but I just like the very structured
> appearance of the above presented.
 
Sebastian Bauhoff 

> > I need to make a graph that looks like a box plot, but 
> shows the mean
> > and 95 percent CI.  Basically I want the graph to have a dot for the
> > mean and a thin like for the CI, and all that for about 10 
> variables on
> > the x-axis.  I unsuccessfully tried to get a twoway graph 
> to work using
> > the code on
> > 
> http://www.ats.ucla.edu/stat/stata/library/GraphExamples/code/
tworcap.htm

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