Median

On this page 7

The median is the value that splits an ordered dataset into two equal halves: half of the observations are less than or equal to it and half are greater than or equal to it. In statistics, it is a measure of central tendency alongside the mean and the mode, and it is identical to the 50th percentile.

Its defining property is robustness. Because the median depends only on the order of values and not on their magnitude, a few extreme outliers barely move it, which makes it the preferred summary for skewed quantities such as income, house prices, response times and waiting times.

How the median is calculated

To compute the median, sort the values in ascending order and locate the middle position. With an odd number of observations n, the median is the value at position (n + 1) / 2. With an even number, it is conventionally the average of the two middle values.

For grouped data in a frequency table, the median is estimated by linear interpolation within the median class, the interval where the cumulative frequency crosses half of the total. Statistical software also offers several quantile definitions that can return slightly different medians for small even-sized samples.

The following worked cases show how the rules apply.

DatasetSorted valuesMedianRule applied
Odd count3, 5, 8, 9, 148Middle value at position 3
Even count2, 4, 7, 105.5Average of 4 and 7
With an outlier3, 5, 8, 9, 14008Outlier does not change the middle
Ties4, 6, 6, 6, 96Repeated values count individually
Median calculation examples

Median, mean and mode compared

The three classic measures answer different questions. The mean balances all values and uses every magnitude, the median marks the typical middle position, and the mode reports the most frequent value. Their relative positions reveal the shape of a distribution.

MeasureDefinitionSensitivity to outliersBest suited for
MedianMiddle of ordered valuesVery lowSkewed data, ordinal scales
MeanSum divided by countHighSymmetric data, totals and further modeling
ModeMost frequent valueNoneCategorical data, peaks
Trimmed meanMean after cutting tailsModerateCompromise between mean and median
Measures of central tendency

In a right-skewed distribution, a long tail of high values pulls the mean above the median, as with salaries. In a left-skewed distribution, the mean falls below it. When mean and median are close, the data is roughly symmetric, although that alone does not prove normality.

Robustness and statistical properties

Robustness is measured by the breakdown point, the share of observations that can be corrupted arbitrarily before the estimate becomes meaningless. The median has the maximum possible breakdown point of 50 percent, while a single extreme value can push the mean anywhere, giving it a breakdown point of essentially zero.

The median also minimizes the sum of absolute deviations, whereas the mean minimizes the sum of squared deviations. This is why median regression, a special case of quantile regression, is used when errors are heavy-tailed. The robust spread measure that pairs naturally with the median is the median absolute deviation (MAD) or the interquartile range.

The price of robustness is lower efficiency on clean normal data. For large normally distributed samples, the median’s sampling variance is about 1.57 times that of the mean, so it needs more observations for the same precision.

PropertyMedianMean
Breakdown point50 percentEffectively 0 percent
Loss it minimizesAbsolute deviationsSquared deviations
Natural spread measureIQR or MADVariance or standard deviation
Efficiency on normal dataAbout 64 percentReference, 100 percent
Combining group resultsNot directly possibleWeighted average of group means
Statistical properties of the median

Using the median in analysis

The median is the standard summary for household income, property prices, latency and durations, where long right tails are normal. In performance monitoring it appears as p50, usually reported next to higher percentiles such as p95 and p99 that capture tail behavior.

For uncertainty, a bootstrap confidence interval is a reliable general method, and the Wilcoxon signed-rank and Mann-Whitney tests are common nonparametric tools when comparing location without assuming normality. Survival analysis reports the median survival time, because many subjects have not yet experienced the event.

SituationPreferred summaryReason
Income or wealthMedianFew very high values distort the mean
Budget totals or forecastsMeanMean times count gives the total
Ordinal survey ratingsMedianIntervals between categories are not equal
Symmetric measurement errorsMeanMore efficient estimate
Web response timesMedian plus tail percentilesShows typical and worst experience
Choosing between median and mean

Common mistakes with the median

  • Averaging medians of subgroups to obtain an overall median, which is generally wrong; the median must be recomputed from the combined data.
  • Reporting the median alone without a spread measure, hiding whether values cluster tightly or vary widely.
  • Forgetting to sort or including missing values coded as zero, which shifts the middle position.
  • Assuming the median is the most common value, which is the definition of the mode.
  • Comparing medians computed with different quantile definitions across tools on small samples.

In simple terms

The median is the value in the middle once everything is lined up from smallest to largest. If eleven people stand in a row ordered by height, the median height belongs to the sixth person.

Its big advantage is that a few extreme values cannot pull it away. If a billionaire joins a room of teachers, the average income in the room jumps enormously, but the median income hardly changes. That is why the median often describes what is typical better than the average does.

A practical example

A city housing office publishes a quarterly report on apartment sale prices. In one district, 240 apartments were sold, most between 180,000 and 320,000 in local currency, but three luxury penthouses sold for more than 2 million each.

The mean price comes out at about 290,000, higher than what most buyers actually paid, while the median price is 238,000. The office reports the median as the headline figure, adds the interquartile range from 205,000 to 271,000, and lists the mean separately for completeness.

Readers comparing districts now see a stable, representative price level that does not jump from quarter to quarter simply because a few exceptional properties happened to sell.