Calculate quartiles, interquartile range, and identify outliers using the 1.5×IQR rule.
The Interquartile Range (IQR) is a measure of statistical dispersion that represents the spread of the middle 50% of a dataset. It's calculated as the difference between the third quartile (Q3) and the first quartile (Q1):
IQR = Q3 − Q1
Key Properties:
When to use IQR: Prefer IQR for skewed distributions, small samples, or datasets with potential outliers. Use standard deviation for symmetric, normally-distributed data.
Arrange all values in ascending order from smallest to largest.
The middle value divides data into lower and upper halves.
The median of the lower half separates the lowest 25% from the rest.
The median of the upper half separates the highest 25% from the rest.
Subtract: IQR = Q3 − Q1. This represents the spread of the middle 50%.
Any value below Q1 − 1.5×IQR or above Q3 + 1.5×IQR is flagged as an outlier.
Dataset: 7, 15, 36, 39, 40, 41, 42, 43, 47, 49, 55 (n=11) Sorted: 7, 15, 36, 39, 40, 41, 42, 43, 47, 49, 55 Positions (0-indexed): Q1 position: 0.25 × (11-1) = 2.5 → between index 2 and 3 Q2 position: 0.50 × (11-1) = 5.0 → exactly at index 5 Q3 position: 0.75 × (11-1) = 7.5 → between index 7 and 8 Linear interpolation: Q1 = data[2] + 0.5 × (data[3] - data[2]) = 36 + 0.5 × 3 = 37.5 Median (Q2) = data[5] = 41 Q3 = data[7] + 0.5 × (data[8] - data[7]) = 43 + 0.5 × 4 = 45.0 IQR = Q3 − Q1 = 45.0 − 37.5 = 7.5 Outlier Detection (1.5×IQR rule): Lower fence = Q1 − 1.5×IQR = 37.5 − 1.5×7.5 = 37.5 − 11.25 = 26.25 Upper fence = Q3 + 1.5×IQR = 45.0 + 1.5×7.5 = 45.0 + 11.25 = 56.25 All values between 26.25 and 56.25, so no outliers detected.
The IQR of 7.5 tells us the middle 50% of data spans 7.5 units. With all values within the fences (26.25–56.25), this dataset has no extreme outliers.
Related Tools