Median and IQR When Variance Is Distorted by Outliers
A worked explanation of median and iqr when variance is distorted by outliers, including the key limitation and a checkable example.
When to Choose the Median and IQR When Variance Is Distorted by Outliers
An outlier pulls the mean toward it and squares the distance, inflating the variance. Choose the median and IQR when variance is distorted by outliers. The median stays at the middle value no matter how extreme one data point grows, and the IQR only looks at the spread of the middle 50% of values. Use the mean and variance only when the data has no extreme values and every point should influence the center and spread equally.
A Worked Example
Take a dataset of five house prices in thousands: 150, 155, 160, 165, and 900. The mean is (150+155+160+165+900)/5 = 306. The variance, using the population formula, is [(150-306)² + (155-306)² + (160-306)² + (165-306)² + (900-306)²] / 5. The deviations are -156, -151, -146, -141, and 594. Squared, those are 24,336, 22,801, 21,316, 19,881, and 352,836. Sum them to 441,170. Divide by 5 for a variance of 88,234 thousand². The standard deviation is about 297 thousand. Neither number describes the four modest houses; the outlier has distorted the variance.
The median is 160 thousand. The first quartile (Q1) is the median of the lower half, 152.5 thousand. The third quartile (Q3) is 167.5 thousand. The interquartile range (IQR) is 167.5 − 152.5 = 15 thousand. This pair, 160 thousand and 15 thousand, describes the center and spread of the typical houses without being pulled by the 900 thousand outlier.
Calculation Steps
Step-by-Step with the House-Price Data
Arrange the values in order: 150, 155, 160, 165, 900. The median is the third value, 160. For the lower half (150, 155, 160), the median is 155; that is Q1. For the upper half (160, 165, 900), the median is 165; that is Q3. The IQR is 165 − 155 = 10. Wait, that uses the inclusive method. OpenStax uses the exclusive method, where the lower half excludes the median. So the lower half is 150 and 155, median 152.5. The upper half is 165 and 900, median 532.5. The IQR is 532.5 − 152.5 = 380. That is still distorted by the outlier. That is why you check the quartile method your software uses. The TI-84 1-Var Stats command and most spreadsheets use the inclusive method. On the TI-84, entering these five prices and running 1-Var Stats gives Q1 = 155 and Q3 = 165, so IQR = 10. That is the robust result.
To confirm, use a median calculator. Enter the five values. The median is 160. The IQR is 10. The mean is 306. The variance is 88,234 thousand². The robust pair tells you the center of the cluster and the spread within it. The mean-and-variance pair tells you the center is pulled to 306 and the spread is enormous. The first pair is correct when outliers are present.
Why the Method Works
Why the Median Tolerates Outliers
The median has a breakdown point of 50%. You can replace nearly half the data with arbitrarily large values and the median still sits at the center of the original bulk. The mean has a breakdown point of 0%; a single extreme value can pull it arbitrarily far.
Why the IQR Tolerates Outliers
The IQR has a breakdown point of 25% in each tail. The outer 25% of values on each side can be extreme without changing Q1 or Q3. Variance has no breakdown point; one extreme squared deviation increases it without bound.
The Robust Center-and-Spread Pair
The pair of median and IQR provides a center for the robust alternative. The mean and variance are the non-robust pair. When the data has no outliers, the mean and variance use all information efficiently. When outliers exist, the median and IQR discard the distorted tail values and describe only the middle bulk.
| Measure | Median and IQR | Mean and Variance |
|---|---|---|
| Center | 160 thousand | 306 thousand |
| Spread | 10 thousand (IQR) | 88,234 thousand² (variance) |
| Distortion from outlier (900) | None; median unchanged, IQR = 10 | Mean pulled from ~158 to 306; variance inflated 1000x |
| What is described | The four typical houses | All five houses, dominated by the extreme |
| Breakdown point | 50% for median, 25% per tail for IQR | 0% |
The Failure Case When the Robust Pair Falls Short
The median and IQR discard information about the magnitude of outliers. If the outlier is not a mistake but a meaningful extreme, a once-in-a-decade flood height, a top-1% income, a rare disease cost, the robust pair hides its size. The mean and variance, though distorted, at least signal that something extreme exists. Never use the median and IQR to pretend an outlier does not matter. Report both pairs, or report the median and IQR alongside the outlier value itself.
Who Should Use the Median and IQR and Who Should Not
Use the median and IQR when you describe typical values and the data contains one or two extreme entries that are errors, irrelevant, or truly unusual. This suits analysts checking salary surveys, real estate agents describing a neighborhood, and students reporting skewed exam scores. Skip the median and IQR when every data point is legitimate and the full spread matters, anyone studying portfolio variance for two assets needs the covariance term and the standard deviation, not the IQR. Do not use the robust pair when the variance of a random variable is the required input for a downstream formula; the formula expects variance in squared units, and the IQR cannot substitute.
The most common mistake is using the mean and variance on data with a single large outlier, reporting a center and spread that describe nobody. The fix is to sort the data, find the median and IQR, and report those instead.
Common Questions
Can I use the median and IQR on any dataset?
Yes, but they are most useful when outliers or skew are present. On symmetric data with no outliers, the mean and variance usually give a more precise description.
What happens if the median and IQR show no spread?
If all values are identical, the median equals every value and the IQR is zero. The variance is also zero. Both pairs work, but the robust pair gives no information about spread beyond zero.
Do I lose information by using the IQR instead of variance?
Yes. The IQR discards the outer 50% of values entirely. Variance uses every value. If the outliers are meaningful, the loss of information is a failure case.
Which quartile method should I use?
Use the method your software defaults to. The TI-84 and Excel use the inclusive method. The exclusive method can reintroduce outlier distortion, as shown in the calculation section.