5
$\begingroup$

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.

$\endgroup$
9
$\begingroup$

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)

$\endgroup$
4
  • 3
    $\begingroup$ For another way to see this, imagine a simple data set with 5 values of 0 and 5 values of 1. Then the quartiles are 0 and 1 and the IQR is 1. So the fences are at -1.5 and 2.5. It is very easy even for the fences to be completely outside the range of the data. $\endgroup$ – Nick Cox Jun 29 '13 at 6:39
  • $\begingroup$ OK, thanks. I see now that with Graphpad "Traditional Tukey whiskers go 1.5 times the interquartile distance or to the highest or lowest point, whichever is shorter." That last part being the source of my grief. The lower whisker stopped at ~0.0625 (my Y-axis is on log2 scale) when I have the whiskers set to "Tukey". It's the same for "Min to Max" whiskers. $\endgroup$ – captainentropy Jul 1 '13 at 19:25
  • 1
    $\begingroup$ @captainentropy If that's the definition it's using, then it's not quite following Tukey; in his definition the whiskers are supposed to go to data points. Not that it especially makes a lot of difference to the look in most cases. (Boxplots are one of those things that have a lot of slightly different variations.) $\endgroup$ – Glen_b Jul 1 '13 at 23:56
  • 2
    $\begingroup$ The standard Tukey definition of the whisker positions is the largest value not exceeding the upper quartile + 1.5 IQR and the smallest value not less than the lower quartile - 1.5 IQR. When Tukey was asked why 1.5, he just said that 1 would be too small and 2 would be too large. $\endgroup$ – Nick Cox Jul 4 '13 at 15:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.