Hi Robert, Your points are well taken. However, I reserve mine, b/c I think without this detailed discussion, an average R user would simply confused the "interquartile range" said in boxplot help file with the results of "IQR". Changing it to "length of box" makes it more exact and consistent, as I stated earlier. With all these being said, this is up to the R core team to decide.
...Tao ----- Original Message ---- > From: Robert Baer <rb...@atsu.edu> > To: "Shi, Tao" <shida...@yahoo.com>; Peter Ehlers <ehl...@ucalgary.ca> > Cc: R Project Help <R-help@r-project.org> > Sent: Thu, May 13, 2010 7:25:09 AM > Subject: Re: [R] Whiskers on the default boxplot {graphics} > > > Hi Peter, > > You're absolutely correct! The description > for 'range' in 'boxplot' help file is a little bit confusing by using the > words > "interquartile range". I think it should be changed to the "length of the > box" > to be exact and consistent with those in the help file for > "boxplot.stats". The issue is probably that there are multiple ways (9 to > be exact) of defining quantiles in R. See 'type= ' arguement for > ?quantile. The quantile function uses type=7 by default which matches the > quantile definition used by S-Plus(?), but differs from that used by SPSS. > Doesn't fivenum essentially use the equivalent of a different "type= " > arguement > (maybe 2 or 5) in constructing the hinges? It seems perfectly reasonable > to talk about 'length of box' (or 'box height' depending how you display the > boxplot), but aren't the hinges simply Q1 and Q3 defined by one of the > possible > quartile definitions (as Peter points out the one used by fivenum)? The > box height does not necesarily match the distance produced by IQR() which > also > seems to use the equivalent of quantile(..., type=7), but it is still an IQR, > is > it not? Quantiles apparantly can be defined in more than one "acceptable" > way (sort of like dealing with ties in rank statistics). The OP seemed to > want an "exact" explanation of the wiskers, and I think Peter has pointed us > at > the definition of quartiles used by fivenum, as opposed to the default > used with quantile(..., "type=7"). All that said, I'm not convinced that > it is wrong to speak of "interquartile range" in 'boxplot' > help. Rob ______________________________________________ R-help@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.