Advertisement

Upper and lower fence calculator

Use interquartile fences to flag unusually low or high observations. Choose the quartile convention used by your course or analysis.

Calculator

First quartile
2.000000
Third quartile
4.000000
Interquartile range
2.000000
Lower fence
-1.000000
Upper fence
7.000000
Values strictly outside fences
1
Flagged observations
Original positionValueSide
5.000000100.000000Above upper fence

Advertisement

How this calculator works

The interquartile range spans the middle half of the data. Subtract a chosen multiple of it from the first quartile and add the same multiple to the third quartile. Values strictly outside the resulting fences are flagged; equality stays inside. The common multiplier is 1.5, while 3 gives wider screening fences. Small data sets can produce different quartiles under different conventions, so this page names the selected method. A flag calls for investigation rather than automatic deletion.

Formula

IQR = Q3 - Q1; lower fence = Q1 - k x IQR; upper fence = Q3 + k x IQR. Flag x < lower or x > upper.

Worked example

Using linear quartiles for 0, 1, 2, 3, 6 gives Q1 = 1 and Q3 = 3. At k = 1.5, fences are -2 and 6, so 6 is not flagged. For 1, 2, 3, 4, 100, fences are -1 and 7 and only 100 is flagged.

Advertisement

Frequently asked questions

Are fences the box-plot whisker endpoints?

Usually whiskers stop at actual observations within the fences. A fence itself need not be an observed value.

What if IQR is zero?

Both fences equal the common quartile. Values different from that number can be flagged even if the numeric difference is small.

Why does another program give different fences?

Check its quantile definition, especially for small samples, and confirm that it uses the same multiplier.

Sources

Advertisement