15

I have constructed some box-plots in R and have several outliers. I know that the default criteria to set outlier limits are:

  • Q3 + 1.5*IQR
  • Q1 - 1.5* IQR

However, I would like outliers classified as values that fall outside of the boundaries:

  • Q3 + 3*IQR
  • Q1 - 3* IQR

Is it possible to set this in R?

csgillespie
  • 57,032
  • 13
  • 142
  • 178
ilaria
  • 151
  • 1
  • 1
  • 4
  • 1
    This recent questions also seems relevant here: http://stackoverflow.com/questions/4946964/in-ggplot2-what-do-the-end-of-the-boxplot-lines-represent – Chase Feb 14 '11 at 17:06

2 Answers2

25

From ?boxplot

range: this determines how far the plot whiskers extend out from the box. If ‘range’ is positive, the whiskers extend to the most extreme data point which is no more than ‘range’ times the interquartile range from the box. A value of zero causes the whiskers to extend to the data extremes.

So set range=3

Ryan Ward
  • 6,110
  • 6
  • 36
  • 48
Ben Bolker
  • 192,494
  • 24
  • 350
  • 426
19

I'd encourage you not to do this without a lot of thought - people expect that the whiskers extend 1.5 IQRs. Changing the range will violate these assumptions and make it easy for people to draw incorrect conclusions from your graphic.

Ben Bolker
  • 192,494
  • 24
  • 350
  • 426
hadley
  • 98,401
  • 28
  • 176
  • 241