Why is the range a weak measure of spread?
The range is maximum minus minimum, so it depends only on the two most extreme values. One outlier can change it enormously while the rest of the data is unchanged, which makes it unstable. IQR or standard deviation use more of the data.
Explain it simply
Suppose you judge how consistent a batter is by only the highest and lowest score of the season. One duck and one century tell you nothing about the 20 innings in between. The range does exactly this.
Example
Delivery times in minutes for a food app: 28, 30, 31, 32, 33, 34.
- Range = 34 - 28 = 6.
Now one order gets stuck in rain and takes 120 minutes:
28, 30, 31, 32, 33, 120.
- Range = 120 - 28 = 92.
Five of the six values did not change, yet the range grew more than fifteen times. The IQR barely reacts. With pandas:
import pandas as pd
t = pd.Series([28, 30, 31, 32, 33, 120])
print(t.max() - t.min()) # 92
print(t.quantile(0.75) - t.quantile(0.25)) # 2.5The IQR of 2.5 still describes the typical orders.
What to say in the interview
"Range uses only two observations, so it is highly sensitive to outliers and tends to grow with sample size. It is fine as a quick sanity check, for example the span of dates in a dataset. For real spread I use the IQR when there are outliers, or standard deviation when the data is roughly symmetric."
Common mistakes
- Comparing ranges of samples with different sizes. A bigger sample usually has a bigger range.