Why the median is not affected by outliers

By Jude Wallis · Published

The median depends only on position in the sorted list, not on how large the values are. Change the largest of five donations from 20 dollars to 2000 dollars and the middle value is still the middle value, so the median holds at 15 while the mean leaps from 15 to 411.

AP Statistics: Unit 1 (topics 1.6 Descriptions for One Quantitative Variable Distributions, 1.7 Summary Statistics for One Quantitative Variable). Choosing a measure of center that suits the shape of a distribution is Unit 1 material in the Fall 2026 AP Statistics course, topics 1.6 and 1.7. Free-response answers are expected to justify the choice, so name the skew or the outlier that makes the median the better summary.

Position, not magnitude

To find the median you sort the data and read off the middle. That procedure asks each value one question: are you above the middle or below it? It never asks how far above.

That is the whole mechanism. An outlier is a value far from the rest, and "far" is a statement about magnitude. Since the median ignores magnitude, an outlier changes nothing about it as long as the value stays on the side of the middle it was already on.

The mean works the opposite way. It adds every value, so every value contributes its actual size. Move one value a long way and the mean has to follow, which is why a statistic that ignores size is called resistant and one that does not is not. The resistant statistic entry gives the formal term, and what is a resistant statistic works through the family.

Watch it happen: one value goes from 20 to 2000

Five people donate to a fundraiser, in dollars: 10, 13, 15, 17, 20. Sorted already, with n=5n = 5, so the median is the 3rd value, 15. The sum is 75, so the mean is 755=15\frac{75}{5} = 15 as well.

Now push the largest donation up in stages and recompute both.

Largest donationDataMeanMedian
2010, 13, 15, 17, 201515
5010, 13, 15, 17, 502115
20010, 13, 15, 17, 2005115
200010, 13, 15, 17, 200041115

The mean travels from 15 to 411, more than twenty-seven times its original value. The median does not move a cent.

Read the last row from the median's point of view. The sorted list is 10, 13, 15, 17, 2000, and the 3rd value is 15. It was 15 before. Whether the top donation is 20 dollars or 2000 dollars, it is still just "the biggest one," occupying the same seat in the sorted list.

Why the mean has no choice but to move

Each of the nn values contributes an equal share, 1n\frac{1}{n}, to the mean. So if one value changes by an amount dd and everything else stays put, the mean shifts by exactly dn\frac{d}{n}.

Check it on the donations. The top value rose by d=200020=1980d = 2000 - 20 = 1980, and n=5n = 5, so the mean should rise by 19805=396\frac{1980}{5} = 396. It went from 15 to 15+396=41115 + 396 = 411, which is what the table shows.

Notice that a bigger sample dilutes an outlier but never immunizes the mean against it. With n=100n = 100, that same 1980-dollar jump would still push the mean up by 1980100=19.8\frac{1980}{100} = 19.8. The effect shrinks, and it never reaches zero. The median's response, by contrast, is exactly zero at every sample size.

What does move the median

The median is resistant, not frozen. Three kinds of change do move it.

A value that crosses the middle. Take the same donations and suppose the gift recorded as 20 was actually 14. Sorted, the data become 10, 13, 14, 15, 17, and the 3rd value is now 14. The median dropped from 15 to 14 because the changed value crossed from above the middle to below it, which pushed 15 up a seat. (The mean fell too, from 15 to 695=13.8\frac{69}{5} = 13.8.)

Adding or removing an observation. Positions are counted from the sample size, so changing nn can change which value is in the middle. Add a sixth donation of 2000 to the original five and the list is 10, 13, 15, 17, 20, 2000. With n=6n = 6 the median is the average of the 3rd and 4th values, 15+172=16\frac{15 + 17}{2} = 16. The median moved by 1 dollar while the mean moved from 15 to about 345.83.

Editing a value that is already in the middle. Change the 15 in 10, 13, 15, 17, 20 to 16 and the median goes to 16. The value did not move seats; it is the seat. The same thing happens with an even sample size, where the median averages the two middle values: 10, 13, 17, 20 has a median of 13+172=15\frac{13 + 17}{2} = 15, and editing the 17 down to 16 gives 13+162=14.5\frac{13 + 16}{2} = 14.5 without a single value changing position. This is why the rule is about the middle positions, not about crossing.

So the accurate statement is not "outliers never affect the median." It is that an outlier affects the median only through the position it occupies, and one extra observation shifts positions by at most half a step.

How far resistance goes

In any data set of three or more values you can take a single value and send it to a million or to minus a million, and the median will not leave the range of the original data. You can do that to several values at once. Only when you have moved about half of them does the median lose its footing, because at that point the corrupted values start occupying the middle positions themselves. The mean, by contrast, can be dragged anywhere you like by changing one value.

The interquartile range inherits most of this protection, and so do percentiles generally, since a quartile is just the 25th or 75th percentile and every percentile is a position. That is why the pairing of median with IQR is the standard summary for skewed data. But the protection is not absolute in a small sample. In the donation data with the 2000, this site's median-excluded (TI-84) convention puts Q1=11.5Q_1 = 11.5 and Q3=17+20002=1008.5Q_3 = \frac{17 + 2000}{2} = 1008.5, because the upper half only contains two values and one of them is the extreme. With n=5n = 5 there simply are not enough observations for a quartile to hide behind.

The range and the standard deviation get no protection at all. Both are built from magnitudes, so both move as far as the outlier does. Here the standard deviation goes from about 3.81 to about 888.28.

What to do with this on the AP exam

The practical payoff is a rule you can state and defend.

  • Skewed or outlier-laden data: report the median and the IQR. Incomes, home prices, hospital stays, response times. Name the reason in your answer, since "the distribution is right-skewed, so the median better describes a typical value" is what earns credit.
  • Roughly symmetric data with no extremes: report the mean and the standard deviation. They use every value and they are what the inference in later units is built on.
  • When they disagree, that gap is information. A mean well above the median points to a long right tail or a high outlier. In the 2000-dollar data the mean is 411 and the median is 15, which screams that one value is doing all the work.

An outlier is never automatically an error to delete. Investigate it, and if it is real, report a resistant summary rather than quietly dropping it. Mean vs median covers the choice in more depth, and the 1.5 times IQR rule covers how outliers get flagged in the first place.

One donation goes from 20 dollars to 2000 dollars

Five donations to a fundraiser, in dollars, are 10, 13, 15, 17, 20. Find the mean and the median. Then the largest donation is corrected to 2000. Recompute both and explain the difference in behavior.

  1. The data are already sorted: 10, 13, 15, 17, 20, with n=5n = 5.

  2. Median: nn is odd, so the median is the 3rd value, which is 15 dollars.

  3. Mean: the sum is 10+13+15+17+20=7510 + 13 + 15 + 17 + 20 = 75, so xˉ=755=15\bar{x} = \frac{75}{5} = 15 dollars.

  4. Now correct the largest value to 2000. Sorted, the data are 10, 13, 15, 17, 2000.

  5. New median: the 3rd value is still 15 dollars. The change happened above the middle position and did not cross it, so the middle seat is occupied by the same value as before.

  6. New mean: the sum is 10+13+15+17+2000=205510 + 13 + 15 + 17 + 2000 = 2055, so xˉ=20555=411\bar{x} = \frac{2055}{5} = 411 dollars.

  7. Check the mean with the shift rule: the value rose by 200020=19802000 - 20 = 1980, and 19805=396\frac{1980}{5} = 396, so the mean should rise from 15 to 15+396=41115 + 396 = 411. It does.

  8. Compare the summaries. The median of 15 still describes a typical donor. The mean of 411 describes nobody in the data set, since four of the five donations are under 20 dollars.

Before: mean 15 dollars, median 15 dollars. After: mean 411 dollars, median 15 dollars. The median is unchanged because the middle position still holds the value 15, while the mean absorbs 19805=396\frac{1980}{5} = 396 dollars of the change and stops describing a typical donation.

A change that does move the median

Using the same original donations 10, 13, 15, 17, 20, suppose instead that the largest gift was misrecorded and was really 14. Recompute the mean and the median, and explain why the median moved this time when it did not move for 2000.

  1. Replace 20 with 14 and re-sort: 10, 13, 14, 15, 17, still with n=5n = 5.

  2. Median: the 3rd value is now 14 dollars, down from 15.

  3. Mean: the sum is 10+13+14+15+17=6910 + 13 + 14 + 15 + 17 = 69, so xˉ=695=13.8\bar{x} = \frac{69}{5} = 13.8 dollars.

  4. Explain the median's move. The changed value went from above the median (20) to below it (14), so it crossed the middle. That pushed every value between them up one position, and 15 moved out of the middle seat while 14 moved in.

  5. Contrast with the 2000 case. There, the changed value stayed above the middle and was never in it, so the middle seat kept the same occupant and the median could not move.

  6. Note the size of the two moves. A 6-dollar change that crossed the middle moved the median by 1 dollar; a 1980-dollar change that did not cross the middle moved it by 0.

Mean 13.8 dollars, median 14 dollars. The median moved because the edited value crossed the middle position, which reshuffled the sorted order. A single edited value moves the median only if it crosses the middle or is itself one of the middle values; an outlier sits at the ends, so it is neither, and how far it travels is irrelevant.

Frequently asked questions

Can an outlier ever change the median?

Only through position. Editing a value moves the median only if the value crosses the middle of the sorted list or is itself one of the middle values, which an outlier never is, and adding a new observation changes nn, which can shift the middle by half a step. Neither effect depends on how extreme the outlier is.

Is 2000 flagged as an outlier by the 1.5 times IQR rule in that data set?

No, and that is worth seeing. With only five values, the median-excluded convention gives Q1=11.5Q_1 = 11.5 and Q3=1008.5Q_3 = 1008.5, so the IQR is 997 and the upper fence sits at 1008.5+1.5×997=25041008.5 + 1.5 \times 997 = 2504. The extreme value inflates the very quartiles used to detect it, an effect called masking, and it is one reason you also look at a graph.

Are the quartiles and the IQR resistant too?

Mostly, and for the same reason: they are positions in the sorted list. In a decent-sized sample an extreme value barely touches them. In a very small sample the halves contain too few values for that to hold, as the five-donation example shows.

Does the same protection apply to the range and the standard deviation?

No. The range is the maximum minus the minimum, so an outlier is usually one of the two numbers in it. The standard deviation squares each distance from the mean, so a far-out value dominates the calculation. In the donation data the standard deviation goes from about 3.81 to about 888.28.

Should I just delete outliers so the mean works again?

No. Delete a value only when you can show it is an error, such as an impossible measurement or a data-entry slip you can verify. A real extreme value is part of the distribution, and the right response is to report the median and IQR and describe the outlier separately.