The median of a set of numbers is the value separating the higher half from the lower half of a data sample, a population, or a probability distribution. For a data set, it may be thought of as the “middle" value. The basic feature of the median in describing data compared to the Arithmetic mean (often simply described as the "average") is that it is not Skewness by a small proportion of extremely large or small values, and therefore provides a better representation of the center. Median income, for example, may be a better way to describe the center of the income distribution because increases in the largest incomes alone have no effect on the median. For this reason, the median is of central importance in robust statistics.
Median is a 2-quantile; it is the value that partitions a set into two equal parts.
If the data set has an odd number of observations, the middle one is selected (after arranging in ascending order). For example, the following list of seven numbers,
has the median of 6, which is the fourth value.
If the data set has an even number of observations, there is no distinct middle value and the median is usually defined to be the arithmetic mean of the two middle values.Simon, Laura J.; "Descriptive statistics" , Statistical Education Resource Kit, Pennsylvania State Department of Statistics For example, this data set of 8 numbers
has a median value of 4.5, that is . (In more technical terms, this interprets the median as the fully trimmed mid-range).
In general, with this convention, the median can be defined as follows: For a data set of elements, ordered from smallest to greatest,
+ Comparison of common of values ! Type ! Description ! Example ! Result | |||
Mid-range | Midway point between the minimum and the maximum of a data set | 1, 2, 2, 3, 4, 7, 9 | 5 |
Arithmetic mean | Sum of values of a data set divided by number of values: | 4 | |
Median | Middle value separating the greater and lesser halves of a data set | 1, 2, 2, 3, 4, 7, 9 | 3 |
Mode | Most frequent value in a data set | 1, 2, 2, 3, 4, 7, 9 | 2 |
The median is well-defined for any Weak ordering (one-dimensional) data and is independent of any distance metric. The median can thus be applied to school classes which are ranked but not numerical (e.g. working out a median grade when student test scores are graded from F to A), although the result might be halfway between classes if there is an even number of classes. (For odd number classes, one specific class is determined as the median.)
A geometric median, on the other hand, is defined in any number of dimensions. A related concept, in which the outcome is forced to correspond to a member of the sample, is the medoid.
There is no widely accepted standard notation for the median, but some authors represent the median of a variable x as med( x), x͂, as μ1/2, or as M. In any of these cases, the use of these or other symbols for the median needs to be explicitly defined when they are introduced.
The median is a special case of other ways of summarizing the typical values associated with a statistical distribution: it is the 2nd quartile, 5th decile, and 50th percentile.
For example, consider the multiset
The median is 2 in this case, as is the mode, and it might be seen as a better indication of the central tendency than the arithmetic mean of 4, which is larger than all but one of the values. However, the widely cited empirical relationship that the mean is shifted "further into the tail" of a distribution than the median is not generally true. At most, one can say that the two statistics cannot be "too far" apart; see below.
As a median is based on the middle data in a set, it is not necessary to know the value of extreme results in order to calculate it. For example, in a psychology test investigating the time needed to solve a problem, if a small number of people failed to solve the problem at all in the given time a median can still be calculated.
Because the median is simple to understand and easy to calculate, while also a robust approximation to the mean, the median is a popular summary statistic in descriptive statistics. In this context, there are several choices for a measure of variability: the range, the interquartile range, the mean absolute deviation, and the median absolute deviation.
For practical purposes, different measures of location and dispersion are often compared on the basis of how well the corresponding population values can be estimated from a sample of data. The median, estimated using the sample median, has good properties in this regard. While it is not usually optimal if a given population distribution is assumed, its properties are always reasonably good. For example, a comparison of the efficiency of candidate estimators shows that the sample mean is more statistically efficient when—and only when— data is uncontaminated by data from heavy-tailed distributions or from mixtures of distributions. Even then, the median has a 64% efficiency compared to the minimum-variance mean (for large normal samples), which is to say the variance of the median will be ~50% greater than the variance of the mean.
Note that this definition does not require X to have an absolutely continuous distribution (which has a probability density function f), nor does it require a discrete one. In the former case, the inequalities can be upgraded to equality: a median satisfies and
Any probability distribution on the real number set has at least one median, but in pathological cases there may be more than one median: if F is constant 1/2 on an interval (so that f = 0 there), then any value of that interval is a median.
More generally, a median is defined as a minimum of as discussed below in the section on multivariate medians (specifically, the spatial median).
This optimization-based definition of the median is useful in statistical data-analysis, for example, in k-medians clustering.
This bound was proved by Book and Sher in 1979 for discrete samples, and more generally by Page and Murty in 1982. In a comment on a subsequent proof by O'Cinneide, Mallows in 1991 presented a compact proof that uses Jensen's inequality twice, as follows. Using |·| for the absolute value, we have
The first and third inequalities come from Jensen's inequality applied to the absolute-value function and the square function, which are each convex. The second inequality comes from the fact that a median minimizes the absolute deviation function .
Mallows's proof can be generalized to obtain a multivariate version of the inequality simply by replacing the absolute value with a norm:
where m is a spatial median, that is, a minimizer of the function The spatial median is unique when the data-set's dimension is two or more.
An alternative proof uses the one-sided Chebyshev inequality; it appears in an inequality on location and scale parameters. This formula also follows directly from Cantelli's inequality. K.Van Steen Notes on probability and statistics
A similar relation holds between the median and the mode:
When the distribution has a monotonically decreasing probability density, then the median is less than the mean, as shown in the figure.
This inequality generalizes to the median as well. We say a function is a C function if, for any t,
is a closed interval (allowing the degenerate cases of a single point or an empty set). Every convex function is a C function, but the reverse does not hold. If f is a C function, then
If the medians are not unique, the statement holds for the corresponding suprema.
Selection algorithms still have the downside of requiring memory, that is, they need to have the full sample (or a linear-sized portion of it) in memory. Because this, as well as the linear time requirement, can be prohibitive, several estimation procedures for the median have been developed. A simple one is the median of three rule, which estimates the median as the median of a three-element subsample; this is commonly used as a subroutine in the quicksort sorting algorithm, which uses an estimate of its input's median. A more robust estimator is John Tukey's ninther, which is the median of three rule applied with limited recursion: if is the sample laid out as an array, and
then
The remedian is an estimator for the median that requires linear time but sub-linear memory, operating in a single pass over the sample.
where is the median of and is the sample size:
A modern proof follows below. Laplace's result is now understood as a special case of the asymptotic distribution of arbitrary quantiles.
For normal samples, the density is , thus for large samples the variance of the median equals (See also section #Efficiency below.)
Now we introduce the beta function. For integer arguments and , this can be expressed as . Also, recall that . Using these relationships and setting both and equal to allows the last expression to be written as
Hence the density function of the median is a symmetric beta distribution pushed forward by . Its mean, as we would expect, is 0.5 and its variance is . By the chain rule, the corresponding variance of the sample median is
The additional 2 is negligible in the limit.
Because the observations are discrete-valued, constructing the exact distribution of the median is not an immediate translation of the above expression for ; one may (and typically does) have multiple instances of the median in one's sample. So we must sum over all these possibilities:
Here, i is the number of points strictly less than the median and k the number strictly greater.
Using these preliminaries, it is possible to investigate the effect of sample size on the standard errors of the mean and median. The observed mean is 3.16, the observed raw median is 3 and the observed interpolated median is 3.174. The following table gives some comparison statistics.
The efficiency tends to as tends to infinity.
In other words, the relative variance of the median will be , or 57% greater than the variance of the mean – the relative standard error of the median will be , or 25% greater than the standard error of the mean, (see also section #Sampling distribution above.).
If data is represented by a statistical model specifying a particular family of probability distributions, then estimates of the median can be obtained by fitting that family of probability distributions to the data and calculating the theoretical median of the fitted distribution. Pareto interpolation is an application of this when the population is assumed to have a Pareto distribution.
In contrast to the marginal median, the geometric median is equivariant with respect to Euclidean similarity transformations such as translations and rotations.
where is the inverse of the conditional cdf (i.e., conditional quantile function) of . For example, a popular model is where is standard normal independent of . The conditional median is the optimal Bayesian estimator:
It is known that for the model where is standard normal independent of , the estimator is linear if and only if is Gaussian.
Alternatively, if in an observed sample there are scores above the median category, scores in it and scores below it then the interpolated median is given by
Nair and Shrivastava in 1942 suggested a similar idea but instead advocated dividing the sample into three equal parts before calculating the means of the subsamples. Brown and Mood in 1951 proposed the idea of using the medians of two subsamples rather the means. Tukey combined these ideas and recommended dividing the sample into three equal size subsamples and estimating the line based on the medians of the subsamples.
The theory of median-unbiased estimators was revived by George W. Brown in 1947:
Further properties of median-unbiased estimators have been reported.
There are methods of constructing median-unbiased estimators that are optimal (in a sense analogous to the minimum-variance property for mean-unbiased estimators). Such constructions exist for probability distributions having monotone likelihood-functions.Pfanzagl, Johann. "On optimal median unbiased estimators in the presence of nuisance parameters." The Annals of Statistics (1979): 187–193. One such procedure is an analogue of the Rao–Blackwell procedure for mean-unbiased estimators: The procedure holds for a smaller class of probability distributions than does the Rao—Blackwell procedure but for a larger class of .
The idea of the median appeared in the 6th century in the Talmud, in order to fairly analyze divergent appraisals. Modern Economic Theory in the Talmud by Yisrael Aumann However, the concept did not spread to the broader scientific community.
Instead, the closest ancestor of the modern median is the mid-range, invented by Al-Biruni Transmission of his work to later scholars is unclear. He applied his technique to currency metals, but, after he published his work, most assayers still adopted the most unfavorable value from their results, lest they appear to Debasement. However, increased navigation at sea during the Age of Discovery meant that ship's navigators increasingly had to attempt to determine latitude in unfavorable weather against hostile shores, leading to renewed interest in summary statistics. Whether rediscovered or independently invented, the mid-range is recommended to nautical navigators in Harriot's "Instructions for Raleigh's Voyage to Guiana, 1595".
The idea of the median may have first appeared in Edward Wright's 1599 book Certaine Errors in Navigation on a section about compass navigation. Wright was reluctant to discard measured values, and may have felt that the median — incorporating a greater proportion of the dataset than the mid-range — was more likely to be correct. However, Wright did not give examples of his technique's use, making it hard to verify that he described the modern notion of median. The median (in the context of probability) certainly appeared in the correspondence of Christiaan Huygens, but as an example of a statistic that was inappropriate for actuarial practice.
The earliest recommendation of the median dates to 1757, when Roger Joseph Boscovich developed a regression method based on the L1 norm and therefore implicitly on the median. In 1774, Laplace made this desire explicit: he suggested the median be used as the standard estimator of the value of a posterior PDF. The specific criterion was to minimize the expected magnitude of the error; where is the estimate and is the true value. To this end, Laplace determined the distributions of both the sample mean and the sample median in the early 1800s.Laplace PS de (1818) Deuxième supplément à la Théorie Analytique des Probabilités, Paris, Courcier However, a decade later, Gauss and Legendre developed the least squares method, which minimizes to obtain the mean; the strong justification of this estimator by reference to maximum likelihood estimation based on a normal distribution means it has mostly replaced Laplace's original suggestion.
Antoine Augustin Cournot in 1843 was the first to use the term median ( valeur médiane) for the value that divides a probability distribution into two equal halves. Gustav Theodor Fechner used the median ( Centralwerth) in sociological and psychological phenomena.Keynes, J.M. (1921) A Treatise on Probability. Pt II Ch XVII §5 (p 201) (2006 reprint, Cosimo Classics, : multiple other reprints) It had earlier been used only in astronomy and related fields. Gustav Fechner popularized the median into the formal analysis of data, although it had been used previously by Laplace, and the median appeared in a textbook by F. Y. Edgeworth. Francis Galton used the term median in 1881,Galton F (1881) "Report of the Anthropometric Committee" pp 245–260. Report of the 51st Meeting of the British Association for the Advancement of Science having earlier used the terms middle-most value in 1869, and the medium in 1880. encyclopediaofmath.org personal.psu.edu
|
|