Curious Minds

Clear answers to science and history questions

Why the Median Is Not Affected by Outliers

· 6 min read · Science

The median is not affected by outliers because it depends only on the middle position of an ordered dataset, not on the magnitude of any single value. Changing an extreme observation—making it larger or smaller—does not change which value sits in the middle, so the median stays the same.

What Outliers Are and Why They Matter

An outlier is a data point that lies far away from the rest of the observations. In a list of household incomes, for example, most values might fall between $30,000 and $80,000, but one household could report $2 million. That single value is an outlier. Outliers can arise from genuine rare events, from measurement error, or from data entry mistakes. Whatever their source, they can distort summary statistics that rely on every value, such as the mean.

The mean (average) adds up all values and divides by the count. Because the sum includes the outlier at full weight, a single extreme value can pull the mean substantially. The median, by contrast, is the middle value after sorting. It ignores how far apart the values are and depends only on their order. This positional nature is the key to its resistance.

How the Median Is Calculated

To find the median, arrange the data in ascending order. If the number of observations is odd, the median is the middle value. If the number is even, the median is the average of the two middle values. For example, consider the dataset {2, 3, 5, 7, 100}. Sorted, it is 2, 3, 5, 7, 100. With five values, the middle is the third: 5. The outlier 100 does not affect the median because it is not in the middle position. If we change 100 to 1,000, the sorted list becomes 2, 3, 5, 7, 1,000, and the median is still 5.

For an even number of values, say {2, 3, 5, 7, 100, 200}, the two middle values are 5 and 7, so the median is (5+7)/2 = 6. Again, changing 200 to 2,000 does not alter the median, because the middle two values remain 5 and 7.

Why Position Matters More Than Magnitude

The median is a positional statistic: it depends on the rank order of values, not their numerical size. Outliers, by definition, are extreme in magnitude but they occupy the highest or lowest ranks. Since the median is determined by the middle rank(s), it is insulated from changes at the extremes. This property is called robustness. The mean, in contrast, is sensitive to every value because it uses the sum. A single outlier can shift the mean dramatically, while the median remains stable.

Consider a small business with five employees earning $30,000, $35,000, $40,000, $45,000, and $50,000. The median salary is $40,000 and the mean is also $40,000. If the highest earner receives a bonus of $1,000,000, the salaries become $30,000, $35,000, $40,000, $45,000, and $1,050,000. The median is still $40,000, but the mean jumps to $240,000. The median better represents the typical salary in this skewed distribution.

Comparing Median and Mean: A Worked Example

To see the difference clearly, take the dataset {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}. The mean is 5.5 and the median is 5.5. Now replace 10 with 1,000. The new dataset is {1, 2, 3, 4, 5, 6, 7, 8, 9, 1,000}. The median is still 5.5 (average of 5 and 6), but the mean becomes (1+2+3+4+5+6+7+8+9+1000)/10 = 104.5. The outlier has inflated the mean by a factor of nearly 20, while the median is unchanged. This illustrates why the median is often preferred for skewed data such as income, house prices, or waiting times.

When the Median Is the Better Choice

The median is particularly useful when the data are skewed or contain outliers. Common situations include:

  • Income and wealth distributions, which are typically right-skewed with a few very high values.
  • House prices, where a few luxury properties can distort the average.
  • Waiting times or service durations, where a few very long waits can pull the mean upward.
  • Any dataset where extreme values are suspected to be errors or rare events.

In these cases, the median gives a more representative picture of a typical observation. However, the median is not always superior. When data are symmetric and free of outliers, the mean uses all information and is often more efficient. The choice depends on the shape of the distribution and the goal of the analysis.

Limitations and Common Misconceptions

While the median is robust to outliers, it is not immune to all data issues. It can still be affected by changes in the middle of the dataset. For example, if a value near the center is altered, the median may shift. Also, the median does not use the full information in the data; it discards the magnitudes of all values except the middle one(s). This can be a disadvantage when data are clean and symmetric, because the mean is more statistically efficient.

A common misconception is that the median is always unaffected by any change. In reality, it is unaffected by changes to values that do not cross the middle position. If an outlier is so extreme that it changes the order of the middle values—for instance, if there are very few data points—the median could change. But in typical datasets with many observations, a single outlier will not alter the median.

Another point: the median is not the same as the mode or the midrange. The midrange, which is the average of the minimum and maximum, is highly sensitive to outliers. The median's robustness comes from its focus on the center of the ordered list.

Frequently Asked Questions

Does the median change if I add an outlier?

Adding an outlier can change the median if the total number of observations changes from odd to even or vice versa, because the middle position shifts. However, the median will not be pulled toward the outlier's value; it will simply be the average of the two central values in the new dataset. In most cases with many data points, the median remains close to its original value.

Is the median always better than the mean?

No. The median is better when data are skewed or contain outliers, but the mean is more efficient for symmetric, outlier-free data because it uses all observations. The choice depends on the distribution and the purpose of the analysis.

Can the median be affected by outliers in small datasets?

In very small datasets, an outlier can affect the median if it changes which values are in the middle. For example, with three values {1, 2, 100}, the median is 2. If the outlier changes to 0, the sorted list is {0, 1, 2} and the median becomes 1. So in small samples, the median can shift, but it is still less sensitive than the mean.

What is the difference between median and average?

The average usually refers to the mean, which is the sum of values divided by the count. The median is the middle value in an ordered list. They are both measures of central tendency but respond differently to outliers.

Why do income reports often use the median?

Income distributions are typically skewed, with a small number of very high earners. The median gives a better sense of what a typical person earns, because it is not inflated by the high earners.

Does the median use all the data?

No, the median only uses the middle value(s) and ignores the magnitude of other values. This is why it is robust to outliers but may be less efficient than the mean for clean data.

In this article
  1. What Outliers Are and Why They Matter
  2. How the Median Is Calculated
  3. Why Position Matters More Than Magnitude
  4. Comparing Median and Mean: A Worked Example
  5. When the Median Is the Better Choice
  6. Limitations and Common Misconceptions
  7. Frequently Asked Questions