Solved – Negative inner fence value in a box and whiskers plot

boxplotdata visualization

I calculated a negative lower inner fence value. I've double checked my work but I can't figure out what's wrong. I was under the impression that these values couldn't be outside of the min and max (duh).

My values range from 0.06188 to 1.90957 and when I plot them in Graphpad it looks fine. I'm plotting with the 10% and 90% percentile whiskers (calculated as 0.515 and 1.359 respectively by Graphpad).

I'm calculating the fraction of my datasets that are outside of the Tukey range (+/- 1.5*IQR), and the 10% and 90% range (possibly outliers). But when I calculate the Tukey fences myself using

lower inner = Q1-1.5(IQR)
upper inner = Q3+1.5(IQR)

I get a negative number for the lower value (-0.06758).

I calculated the 10%/90% using Graphpad, so that's not a problem for now.

Here's are the values, if anyone wants to recreate my calculations.

0.06187564,0.2931995,0.4433044,0.4908953,0.4992562,0.5123487,0.5188922,0.5326462,
0.5400167,0.5722309,0.6232626,0.6340977,0.6361935,0.6417624,0.6618853,0.6727413,
0.6990075,0.7250414,0.7575482,0.8221549,0.8573231,0.8732418,0.8749654,0.8751485,
0.88039,0.8831163,0.8842309,0.8927583,0.9143585,0.9371856,0.9644587,0.9662355,
0.9758021,0.9919777,1.004403,1.027557,1.037168,1.057354,1.075599,1.110754,1.120563,
1.135613,1.135632,1.135986,1.137239,1.148205,1.156857,1.175097,1.197407,1.21761,
1.219516,1.265934,1.304216,1.310815,1.336853,1.341317,1.357579,1.359387,1.462214,
1.552785,1.621189,1.760872,1.909566

It has to be something dumb I'm missing.

Best Answer

You just calculated the limits on where the whiskers can go, not the whisker ends themselves (which are limited to the range of the data).

The actual whiskers go out to the furthest-out data value inside the (inner) fences. The fences can go outside the data, but aren't actually plotted.

from data to boxplot

(for more details see this image, which is from this page)