[S] plotting mean values on boxplots

Karen_Johnson@bdhq.bd.com
Wed, 22 Apr 1998 15:04:00 -0400


From: Karen Johnson@BDX on 04/22/98 03:04 PM
I am using V4 on Windows NT.

I would like to add points representing means on the boxplots. I
have been unsuccesful in deciphering the spacing of the boxplots
from the code - it tells me boxplot is an old S function and I
can't get to it. I have resorted to using locator to find the
centerline of the boxplots - which is awkward and not that
accurate.

Does anyone know how the spacing between boxplots is calculated?
Or perhaps have another way to do this?

Thanks, KJJ

# example
boxplot(split(resp, cat), style.bxp='att')
m <- sapply(split(resp, cat), function(x)
mean(na.omit(x)))
points(x, m, pch=15)
# where is x is approximated with locator()

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news