In my work, when individuals refer to the "mean" value of a data set, they're typically referring to the arithmetic mean (i.e. "average", or "expected value"). If I provided the geometric mean, people would likely think I'm being snide or non-helpful, as the definition of "mean" is known in advance.
I'm trying to determine if there are multiple definitions of the "median" of a data set. For example, one of the definitions provided by a colleague for finding the median of a data set with an even number of elements would be:
Algorithm 'A'
- Divide the number of elements by two, round down.
- That value is the index of the median.
- i.e. For the following set, the median would be
5
. [4, 5, 6, 7]
This seems to make sense, though the rounding-down aspect seems a bit arbitrary.
Algorithm 'B'
In any case, another colleague has proposed a separate algorithm, which was in a stats textbook of his (need to get the name and author):
- Divide the number of elements by 2, and keep a copy of the rounded-up and rounded-down integers. Name them
n_lo
andn_hi
. - Take the arithmetic mean of the elements at
n_lo
andn_hi
. - i.e. For the following set, the median would be
(5+6)/2 = 5.5
. [4, 5, 6, 7]
This seems wrong though, as the median value, 5.5
in this case, isn't actually in the original data set. When we swapped out algorithm 'A' for 'B' in some test code, it broke horribly (as we expected).
Question
Is there a formal "name" for these two approaches to calculating the median of a data set? i.e. "lesser-of-the-two median" versus "average-the-middle-elements-and-make-new-data median"?