[R] Whiskers on the default boxplot {graphics}

Peter Ehlers ehlers at ucalgary.ca
Fri May 14 20:07:09 CEST 2010


Just to put this topic to rest:

The hinges match quantile(x, probs = c(1,3)/4, type = 2) except when n
= 3 mod 4.

I no longer have Tukey's EDA book, but I think that his idea was that
hinges (aka quartiles) were defined as medians of the lower/upper
halves of the (sorted, of course) data, where a 'half' would include
the median for odd sample sizes. And that's how they are calculated
in fivenum().

Thus hinges are a 10th definition of quartiles, but they don't lend
themselves to generalization to arbitrary quantiles other than, say,
octiles or other (1/2^k)-iles.

  -Peter

On 2010-05-13 11:47, David Winsemius wrote:
> I agree. I was convinced by Ehlers' example that type =2 was a better
> match to fivenum's result
>

-- 
Peter Ehlers
University of Calgary



More information about the R-help mailing list