Quartiles, IQR and the 1.5 x IQR Outlier Rule
The interquartile range (IQR = Q3 - Q1) measures the spread of the middle half of the data; values beyond 1.5 x IQR from the quartiles are flagged as outliers.
Sort the data and split it into four equal parts. Q1 (first quartile, 25th percentile) is the median of the lower half, Q2 is the median, and Q3 (third quartile, 75th percentile) is the median of the upper half, which is the middle number between the median and the highest value. The IQR is Q3 - Q1 and holds the middle 50 percent of the data.
Outlier rule: a value is usually flagged as an outlier when it is lower than Q1 - 1.5 x IQR or higher than Q3 + 1.5 x IQR. A boxplot draws Q1, the median and Q3 as a box and shows points outside those fences individually. The five-number summary is minimum, Q1, median, Q3 and maximum.
The IQR is a robust measure of spread: unlike the standard deviation it barely changes when an extreme value is added.
Key points
- IQR = Q3 - Q1.
- Q3 is the median of the upper half, the 75th percentile.
- Outlier fences: Q1 - 1.5 x IQR and Q3 + 1.5 x IQR.
- Five-number summary: min, Q1, median, Q3, max.
- IQR is robust to outliers.
Worked example
Data: 2, 4, 5, 6, 8, 9, 10, 40. Q1 = 4.5, Q3 = 9.5, so IQR = 5. Upper fence = 9.5 + 7.5 = 17, so 40 is an outlier. Lower fence = 4.5 - 7.5 = -3, so nothing is low.
Common questions
What is the IQR?
Q3 minus Q1, the range of the middle 50 percent of the data.
What multiple of IQR marks an outlier?
1.5 x IQR beyond Q1 or Q3 is the usual rule.
Practice questions on this topic
Try these, then open the app to check your answers with explanations.
- The difference between Q3-Q1 is (Inter-quartile range: IQR)
- A. True
- B. False
- The middle number between the median and the highest of the data set.
- A. Q3
- B. Q1
- C. IQR
- D. none of the above
- Usually, a value higher/lower than 1.5 x IQR
- A. mean
- B. outlier
- C. deviation
Related topics
- Data Cleaning: Noise, Outliers, Missing Values and Inconsistent Data
- Binning: Equal-Width vs Equal-Frequency (Equal-Depth) with Examples
- Data Normalization: Min-Max, Z-Score and Decimal Scaling with Examples
- Data Reduction: Sampling, Aggregation, Dimensionality Reduction and Compression
- What is Data Mining? Tasks: Classification, Clustering, Regression, Association Rules
- The KDD Process: Knowledge Discovery in Databases Steps
- All topics: Data Mining
BASMAGLY is an independent student project, not an official Delta University site. Check lectures and your instructor for the final word.