TransWikia.com

How does BoxWhiskerChart detect outliers?

Mathematica Asked by Szabolcs on January 15, 2021

BoxWhiskerChart can detect and show outliers:

SeedRandom[39]
BoxWhiskerChart[
  RandomVariate[NormalDistribution[], 100],
  "Outliers"
]

enter image description here

  • What is the precise mathematical criterion used to decide if a point is an outlier?
  • Can this criterion be tweaked?
  • Is this criterion implemented by any documented built-in function?

2 Answers

iqrc = "IQRCoefficient" /. ChartElementData["BoxWhisker", "Options"];

1.5

fences = Quartiles[data][[{1, 3}]] + {-1, 1} iqrc InterquartileRange[data]

outliers = Select[Not @* Between[fences]] @ data

{-3.0844, -3.4005}

which matches the vertical coordinates of outlier glyphs:

Cases[BoxWhiskerChart[data, "Outliers", PerformanceGoal -> "Speed"], 
 Inset[_, {_, a_}] :> a, All]

{-3.0844, -3.4005}

Correct answer by kglr on January 15, 2021

It is actually in the help documentation as the last item. Outliers are 1.5 InterQuartileRanges (IQR) away from the nearest quartile and Far Outliers are 3 IQR distant.

 Documentation Snippet from Properties & Relations

Answered by Mark Kotanchek on January 15, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP