# [R] Whiskers on the default boxplot {graphics}

Jason Rupert jasonkrupert at yahoo.com
Wed May 12 04:26:25 CEST 2010

```Wowzers...

From ?boxplot.stats:

Details

The two ‘hinges’ are versions of the first and third quartile, i.e., close to quantile(x, c(1,3)/4). The hinges equal the quartiles for odd n (where n <- length(x)) and differ for even n. Whereas the quartiles only equal observations for n %% 4 == 1 (n = 1 mod 4), the hinges do so additionally for n %% 4 == 2 (n = 2 mod 4), and are in the middle of two observations otherwise.

The notches (if requested) extend to +/-1.58 IQR/sqrt(n). This seems to be based on the same calculations as the formula with 1.57 in Chambers et al. (1983, p. 62), given in McGill et al. (1978, p. 16). They are based on asymptotic normality of the median and roughly equal sample sizes for the two medians being compared, and are said to be rather insensitive to the underlying distributions of the samples. The idea appears to be to give roughly a 95% confidence interval for the difference in two medians.

Is a notch equal to the upper/lower whisker?   Is this just a difference of terminology or something?

Thanks again for all the insights.

----- Original Message ----
From: David Winsemius <dwinsemius at comcast.net>
To: Jason Rupert <jasonkrupert at yahoo.com>
Cc: R Project Help <R-help at r-project.org>
Sent: Tue, May 11, 2010 9:00:15 PM
Subject: Re: [R] Whiskers on the default boxplot {graphics}

On May 11, 2010, at 9:45 PM, Jason Rupert wrote:

> How are the lower/upper whiskers defined in the default version of boxplot {graphics}?
>
> I tried help(boxplot) and searching www.rseek.org, but I was unable to determine an absolute answer.

You need to follow the links from the help pages and tin this case it appears that you did not follow the one to

?boxplot.stats

>
> I checked out the definition of boxplot according to Wikipedia (http://en.wikipedia.org/wiki/Box_plot), but it also had several approaches
> listed for how the whiskers could be determined, so I'm just curious how the default
> boxplot {graphics} does it.
>
> Thanks for any feedback

> and insights.

David Winsemius, MD
West Hartford, CT

```