I tried to calculate the median of a set of numbers in Excel using the MEDIAN() function and got 13. However, while 7 values are below 13, above it are 8 values. 7 is not equal to 8, so why is it "the median"?
$\begingroup$
$\endgroup$
2
-
2$\begingroup$ Not directly an answer to your question, but related, and likely to be of interest -- R implements nine different definitions for sample quantiles in its quantile function. (e.g. see the discussion here) $\endgroup$– Glen_bCommented Jan 11, 2017 at 11:18
-
1$\begingroup$ Tim gives the reference for the different definitions (Hyndman&Fan) here $\endgroup$– Glen_bCommented Jan 11, 2017 at 12:10
Add a comment
|
1 Answer
$\begingroup$
$\endgroup$
7
When the number of numbers in the set is an odd number, the median is the point in the middle. For a set of 17 numbers, the median is the 9th number (here 13). This way the median fits exactly its definition "the median is the value separating the higher half from the lower half".
-
$\begingroup$ So it's as if the second of the two scores equaling 13 were part of the "upper half" of scores? $\endgroup$ Commented Jan 9, 2017 at 18:59
-
$\begingroup$ If it were an even number of points, say 20, you would average the 10th and eleventh ordered values. $\endgroup$ Commented Jan 9, 2017 at 19:00
-
1$\begingroup$ @CopperKettle Yes, the second 13 is part of the "upper half". Sometimes you can even find the same value in both halves, like in (1, 13, 13, 13, 13). $\endgroup$– PereCommented Jan 9, 2017 at 19:01
-
7$\begingroup$ The Wikipedia quotation doesn't hold up when confronted with examples like the (1,13,13,13,13) dataset: in that case, 13 does not separate the halves (because they cannot be separated: they overlap). Tukey's characterization of the median is more effective: at least half the data equal or exceed the median and at least half the data equal or are less than the median. That criterion determines a unique median for an odd count and a unique range of the median (bounded by two successive order statistics) for an even count. $\endgroup$– whuber ♦Commented Jan 9, 2017 at 19:17
-
$\begingroup$ @whuber I like your first point. On the rule for defining the sample median for even sample sizes I think the literature is not totally consistent. Some take the average (midpoint, median) of the two middle points and others take the whole range between them as you indicated. $\endgroup$ Commented Jan 9, 2017 at 20:11