[R] Boxplot with quartiles generated from different algorithms

Charilaos Skiadas skiadas at hanover.edu
Thu Apr 12 04:09:49 CEST 2007


On Apr 11, 2007, at 7:59 AM, Pietrzykowski, Matthew (GE, Research)  
wrote:

> R users:
>
> I am trying to replicate the boxplot output I achieve with Minitab  
> in R.
> I realize that R gives the user many more options on the algorithm  
> used
> to
> calculate the IQR than Minitab, so I concentrated on type=6 when using
> the quantile() function in R.  The problem I am having is setting the
> upper and
> lower limit of the whisker based on the nearest actual data that  
> should
> be included.
> If the last sentence is unclear, setting the boxplot$stats rows 1  
> and 5
> to the right
> values based on the IQR from the type=6 setting of the quantile
> function.  Is there
> an easy way to do this for a data frame or matrix?

Seeing as noone else answered this (at least not onlist), I'll give  
it a go I think. If I understand your question correctly, you know  
how to find the values you want for boxplot$stats rows 1 and 5, your  
question is how to get boxplot to accept them. If so, you should be  
able to simply do the following three steps:

pl <- boxplot(....)
pl$stats[1] <- ....
bxp(pl)

I suppose the question that remains then is whether you can do this  
by a single direct call to boxplot. I had this question a couple of  
months ago, because I wanted to make the output of boxplot be what my  
students were expecting from what they had learned (Moore & McCabe)  
and wasn't able to find an answer. I'd love to find out if there is one.

> Many thanks,
>
> Matt

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College



More information about the R-help mailing list