[R] Whiskers on the default boxplot {graphics}

David Winsemius dwinsemius at comcast.net
Wed May 12 05:58:28 CEST 2010


On May 11, 2010, at 10:35 PM, Jason Rupert wrote:

> Humm....Maybe I need to look some place else than boxplot.stats  
> {grDevices} for a definition of how the upper/lower whiskers are  
> produced.
>
> By any chance are they "the lowest datum still within 1.5 IQR of the  
> lower quartile, and the highest datum still within 1.5 IQR of the  
> upper quartile"?
>
> None of the links from boxplot.stats {grDevices} seemed to reveal  
> the secret definition of the R whiskers.

You didn't need to go to any other pages. You just needed to read  
boxplot.stats ... apparently more than once.

-- 
David.
>
> Thanks again.
>
>
>
>
>
> ----- Original Message ----
> From: Jason Rupert <jasonkrupert at yahoo.com>
> To: David Winsemius <dwinsemius at comcast.net>
> Cc: R Project Help <R-help at r-project.org>
> Sent: Tue, May 11, 2010 9:26:25 PM
> Subject: Re: [R] Whiskers on the default boxplot {graphics}
>
> 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
>
> Follow links with the R help system.
>
>> and insights.
>
>
>
> David Winsemius, MD
> West Hartford, CT
>
>
>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>
>
>
>

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list