Math glossary

Median: How to Find the Middle in Raw and Grouped Data

Find the median from odd and even data, use a frequency table, estimate grouped medians, and check six worked examples.

TL;DR

The median is the middle value after sorting the data. For an odd count, take the single middle value. For an even count of numerical data, average the two middle values.

Key Points

  • Sort the observations from smallest to largest before finding the middle.
  • Repeated values count as separate observations.
  • A frequency table can give the exact median through cumulative counts.
  • Data grouped into intervals generally give an estimated median.
  • The median depends on position, so a change to an extreme value may leave it unchanged.

What is the median?

The median is a measure of centre that uses the order of the observations. For a sorted list with an odd number of observations, it is the middle entry. For an even number of numerical observations, it is the arithmetic mean of the two central entries. The result can lie between values and need not appear in the original list. NIST, Measures of Location

Count nn Position or positions, starting at 1 Rule
Odd (n+1)/2(n+1)/2 Use that observation
Even n/2n/2 and n/2+1n/2+1 Average those two observations

For example, in 2,6,82,6,8, the median is 6. In 2,6,8,122,6,8,12, the median is (6+8)/2=7(6+8)/2=7. See the comparison of mean, median, and mode for when to use each measure. OpenStax, Mean, Median and Mode

Four sorted values negative five, negative two, six, and eleven have middle values negative two and six
The two central entries are −2-2 and 6. Their average, 2, is the median.

How do you find the median in a frequency table?

Sort the listed values and add a cumulative frequency column. The cumulative count tells you how many observations have been reached at that row. Locate the row that contains each central position.

If the central position is 5 and the cumulative count goes from 3 to 7 on a row, the fifth observation has that row’s value. If two central positions fall in different rows, use both values before averaging. A frequency count of zero adds no observations. Numutility, Median from a Frequency Table

How do you estimate the median from grouped intervals?

Groups such as 10–20 do not identify individual measurements. First find the class where the cumulative count reaches half the total. A common estimate assumes observations are spread evenly within that class. Let LL be its lower boundary, NN the total count, CC the cumulative count before the class, ff its frequency, and ww its width. Estimate the median as

L+(N/2−Cf)w.L+\left(\frac{N/2-C}{f}\right)w.

The fraction shows how far into the class the halfway position falls under the uniform-within-class assumption. If the data only identify intervals, label the result an estimate. If the halfway point falls exactly at a class boundary, the interpolated value is the boundary under this convention. The original data are still needed to compute the exact sample median. Math Lab, Median of Grouped Data

When is the median useful?

Use the median when you want a middle position and a few large or small values could pull the mean away from most observations. For example, the middle delivery time may describe an ordinary trip even when one trip had an unusually long delay. Report the mean too if total time or resource use matters.

A median describes a centre but says little about variation by itself. Two groups can share the same median and have different ranges. Use the range guide or the mean absolute deviation guide when the spread matters. OpenStax, Principles of Data Science: Measures of Center

Worked Median Examples

Example 1

Find the median of 14,3,9,11,914,3,9,11,9.

  1. Sort the list as 3,9,9,11,143,9,9,11,14.
  2. With five observations, the central position is 3.
  3. The median is 9.

Example 2

Find the median of −5,−2,6,11-5,-2,6,11.

  1. The list is already in order and has four entries.
  2. The central positions are 2 and 3, with values −2-2 and 6.
  3. The median is (−2+6)/2=2(-2+6)/2=2.

Example 3

A frequency table records value 2 three times, value 5 once, and value 8 four times. Find the median.

  1. The total count is 8, so use positions 4 and 5.
  2. The cumulative counts are 3, 4, and 8. Position 4 gives 5, and position 5 gives 8.
  3. The median is (5+8)/2=6.5(5+8)/2=6.5.

Example 4

Estimate the median when [0,10)[0,10), [10,20)[10,20), and [20,30)[20,30) have frequencies 4, 10, and 6.

  1. There are 20 observations. The cumulative counts are 4, 14, and 20.
  2. The halfway position of 10 falls in the second class. Here L=10L=10, C=4C=4, f=10f=10, and w=10w=10.
  3. The estimate is 10+[(10−4)/10](10)=1610+[(10-4)/10](10)=16.

Example 5

Compare the mean and median for 2,4,5,7,422,4,5,7,42. Then replace 42 with 100.

  1. Both lists have middle value 5.
  2. The first list sums to 60, giving mean 12.
  3. The changed list sums to 118, giving mean 23.6. The extreme change moves the mean while the middle position stays fixed.

Example 6

The sorted list 2,4,x,11,152,4,x,11,15 has a median of 8. Find xx.

  1. There are five observations, so the median is the third entry.
  2. This means x=8x=8.
  3. The answer respects the given order because 4≤8≤114\le8\le11.

Mistakes That Change a Median

Mistake 1: Choosing the middle before sorting

A list’s written order may be arbitrary. Sort by value before reading any position.

Mistake 2: Counting unique values instead of all observations

In 1,1,1,10,121,1,1,10,12, the median is 1. Deleting repeated observations would give a different dataset.

Mistake 3: Averaging all the values in an even list

That computes the mean. The median uses the two central positions only.

Try It Yourself

  1. Find the median of 12,2,6,18,912,2,6,18,9.
  2. Find the median of 5,7,12,145,7,12,14.
  3. A table shows value 3 twice, value 6 three times, and value 9 twice. Find the median.

Answers and Reasoning

  1. The ordered data are 2,6,9,12,182,6,9,12,18, so the central value is 9.
  2. The middle values are 7 and 12. Their average is 9.5.
  3. Position 4 lies among the three observations with value 6, so the median is 6.

Frequently Asked Questions

Is the median the same as the 50th percentile?

It is commonly described as the 50th percentile. The school-data rule averages the two central values in even numerical lists. Software can offer different conventions for other percentiles.

Can a median be negative?

Yes. The median of −8,−3,2-8,-3,2 is −3-3.

Can you use the median for categories?

You can identify the middle rank for ordered categories such as low, medium, and high. If two different categories occupy the middle positions, report those categories or follow the study’s stated convention. Ordinary numerical averaging needs a numeric scale.

Conclusion

  • Sort the observations and find the central position or positions.
  • Use cumulative counts for an exact frequency table and interpolation for grouped intervals.
  • Interpret the median as a centre and report a spread measure when relevant.

Read More

Research Behind This Article

  1. NIST, Engineering Statistics Handbook: Measures of Location. NIST
  2. OpenStax, Contemporary Mathematics: Mean, Median and Mode. OpenStax
  3. OpenStax, Principles of Data Science: Measures of Center. OpenStax
  4. Numutility, How to Find the Median from a Frequency Table. Numutility
  5. Math Lab, Median of Grouped Data. Math Lab