Median
Put simply, the median splits a set of values so that half of the values are smaller than the median and the other half are larger. In reality it is a little more complicated, and that is what we look at now.
What is the median
For the median it matters whether the number of items in the data set is even or odd. If the number of items is odd, we find the median by putting all the values in order from smallest to largest, and the value exactly in the middle is the median.
As an example, take the set of numbers 75, 4, 2, 3, 2, 5, 1. There are 7 of them, which is an odd number. Putting them in order gives the sequence 1, 2, 2, 3, 4, 5, 75. The median, which we write med(X), is the item in the middle, which is the number 3. The general formula for a data set X of size |X| = N, whose items xi are ordered from smallest to largest, is:
If we try it for our set of values X = [1, 2, 2, 3, 4, 5, 75], we get:
For an even number of items we have to make a small adjustment, because an even number of values has no “middle item”. If we remove one of the 2s from our data set, we get Y = [1, 2, 3, 4, 5, 75], which has no middle item. The numbers 3 and 4 are both “equally in the middle”. In this case we take the two middle items, and the median is their arithmetic mean. The median of the values Y would therefore be (3 + 4)/2 = 3.5.
The general formula for values X of size N with ordered items xi would look like this:
If we work out the median of the values Y = [1, 2, 3, 4, 5, 75] this way, writing the items as yi, we get:
Advantages of the median
Unlike the mean, the median is not troubled by extreme values in a data set. In the example above, with the set X = [1, 2, 2, 3, 4, 5, 75], the mean would be 92 / 7 ≈ 13.1429, which is a rather odd value when six of the seven items are far smaller. The median is the sensible number three.
The median can also be used for any values that can be put in order. We can only find the mean of values that we can add up and then divide. Take clothes sizes, for example: there is usually a sequence such as XS, S, M, L, XL, XXL. It would be hard to find the mean of such values, because it is not clear how to add XS + L or XL + L, nor how we would divide the result in the end. However, if a group of people bought clothes in sizes S, S, M, L, L, L, XXL, we can say that the median is size L. A problem can arise when there is an even number of sizes, because then we cannot take an arithmetic mean. In this case we usually just choose one of the two middle values as the median.
Chapters: Mean (average), Median, Mode, How to work out an average grade, Geometric mean, Harmonic mean