Interquartile range

The interquartile range (IQR) is a measure of variability, based on dividing a data set into quartiles. Quartiles divide a rank-ordered data set into four equal parts. The values that divide each part are called the first, second, third, and fourth quartiles; and they are denoted by Q1, Q2, Q3, and Q4, respectively.

Algorithm: Interquartile range-based outliers

Input: Set of attributes for data points

Output: Set of data points that are statistical outliers

Method:
  1. Arrange data in order
  2. Calculate first quartile (Q1)
  3. Calculate third quartile (Q3)
  4. Calculate interquartile range (IQR)=Q3-Q1
  5. Calculate lower boundary LB = Q1-(1.5*IQR)
  6. Calculate upper boundary UB = Q3+(1.5*IQR)
  7. Anything outside the lower and upper boundary is an outlier
Note: Q2 and Q4 are not used in the calculation.

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.