June 15, 2012
By

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

From Wiki:

“… the bottom and top of the box are always the 25th and 75th percentile (the lower and upper quartiles, respectively), and the band near the middle of the box is always the 50th percentile (the median). But the ends of the whiskers can represent several possible alternative values…”

In R’s default boxplot{graphics} code,

upper whisker = min(max(x), Q_3 + 1.5 * IQR)
lower whisker = max(min(x), Q_1 – 1.5 * IQR)

where IQR = Q_3 – Q_1, the box length.
So the upper whisker is located at the *smaller* of the maximum x value and Q_3 + 1.5 IQR,
whereas the lower whisker is located at the *larger* of the smallest x value and Q_1 – 1.5 IQR.

Here is a full discussion about the whisker of boxplot in default R code:
http://r.789695.n4.nabble.com/Whiskers-on-the-default-boxplot-graphics-td2195503.html

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.