[R] boxplot $conf

Liaw, Andy andy_liaw at merck.com
Thu Jul 18 14:59:23 CEST 2002

> From: CJSwanepoel at t-online.de [mailto:CJSwanepoel at t-online.de]
> Hello R-Help,
> Could anybody tell me how the boxplot-function calculates the upper
> and
> lower extremes of the notch contained in $conf which I assume is the
> confidence interval? Is it reliable for data which is not normally
> distributed? If not, how can I calculate and boxplot a specific
> confidence interval for not normally distributed data in R (increasing
> the sample size does not normalize the sample distribution)?

Looking at the body of the function boxplot.stats, the CI for median (the
notches in the boxplot) is calculated as:

  median +/- 1.58 * box length / sqrt(n)

where box length is roughly the IQR (75th percentile - 25th percentile)
[technically, it's the "H-spread").  Description and explanation can be
found on page 79 of "ABC of EDA" by Vellman & Hoaglin.  It's based on normal
approximation, but for large sample this is suppose to be a very good


Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named on this message.  If you are not the intended recipient, and have received this message in error, please immediately return this by e-mail and then delete it.


r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list