How to find the median

Analytika TeamLast reviewed 4 min read

The median splits a dataset in half. Because it depends only on order, not on the size of the largest or smallest values, it’s the go-to average for skewed data.

How to find the median

  1. Sort the values from smallest to largest.
  2. If there’s an odd number of values, the median is the middle one, at position (n + 1) / 2.
  3. If there’s an even number, average the two middle values, at positions n / 2 and n / 2 + 1.

Odd example

3, 7, 8, 12, 15 has 5 values, so the median is the 3rd: 8.

Even example

3, 7, 8, 12, 15, 20 has 6 values, so the median is the average of the 3rd and 4th: (8 + 12) / 2 = 10.

Why the median resists outliers

Change the largest value in the odd example from 15 to 1,500 and the median stays at 8, while the mean jumps from 9 to 306. That robustness is why medians are used for incomes and house prices, and why the median and mean differ so much in skewed data. Daily ozone readings in R’s airquality data have a mean of 42.1 but a median of 31.5, because a few heavily polluted days pull the mean up.

When to use the median

  • Skewed continuous data: income, time-to-event, costs, reaction times.
  • Data with outliers that are genuine but unrepresentative.
  • Ordinal data: rankings and single rating items, where the distances between values aren’t known to be equal.
  • With rank-based tests such as Mann-Whitney and Kruskal-Wallis, which go with medians rather than means.

The median and other percentiles

The median is the 50th percentile, the second quartile. Together with the first and third quartiles it gives the interquartile range, the spread measure that goes with it. See quartiles and percentiles.

Reporting

Fuel economy had a median of 19.20 mpg (IQR = 15.43–22.80).

In APA style, the median is abbreviated Mdn. For comparison with the other averages, see mean, median and mode.

More in Descriptive statistics

Try it with the free tools

Run this on your own data

Upload a dataset and ask your question in plain English. Analytika checks the assumptions, picks the test, runs it, and writes the results up in APA format.

Try it free