Ernest Berkhout
>
> is it possible to create a boxplot in which not only the
> median is plotted,
> but also the mean? It appears to me that momentarily this
> option is not
> available, am i overlooking something? More experienced
> users could create
> such a graph with twoway-overlaying a rcap, a rbar and two
> scatters but of
> course it would be more elegant to have it as an option in
> <graph boxplot>
Sounds a very good idea to me.
The only device which springs to mind -- other
than superimposing -yline(<mean>)- or something
similar -- is to construct a variable identically
equal to the mean and then put the boxes side by side:
egen mean = mean(mpg), by(foreign)
graph box mpg mean, over(foreign)
but that isn't nearly as neat as could be desired.
Working backwards, this question prompted me
to add a -mean- option to -eqprhistogram- (previously
posted on SSC). In many circumstances, that histogram
shows more information than a box plot. However,
it doesn't lend itself to side-by-side
comparison of different variables or groups
which is a main virtue of boxplots. N.B. I'm
keeping the code to myself while making other
additions.
Nick
[email protected]
*
* 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/