Briefly |
Subtract the 25th percentile from the 75th percentile. |
There is surprising disagreement about how to calculate interquartile range. These differences are usually small, especially for large data sets with continuous values.
Fathom simply calculates the 75th percentile and the 25th percentile, and subtracts.
The "Excluded-Median" technique
Many books use the following technique, which can give a slightly different result:
1. First, put your data values in order.
2. Find the middle case (its value is the median).
3. Throw out the middle case (If there is no middle case, don't throw anything out.) Now you have two sets of ordered data values, both the same size.
4. Find the median value for each of these sets.
5. Subtract the smaller from the larger. This is the interquartile range.
Note that if there are multiple values of the median, you only throw out the one case. You do not throw out all cases with that value.
This strategy appears in numerous popular statistics texts, notably by Moore & McCabe; Yates, Moore, & McCabe; Wardrop; and Mann. Its advantage is that it's easy to calculate by hand, especially if you have only a small number of data points.
What Alternatives Are There?
This method isn't the only one. Tukey, who invented a lot of exploratory data analysis (EDA), named these two quantities "hinges," but included the median in both the top and bottom half instead of excluding it. Other authors (notably Siegel & Morgan and Devore & Peck) go that route, including the median case.