Median

The median is a measure of central tendency defined by the point that divides an ordered distribution into lower and upper portions of equal probability. For a finite dataset, at least half of the observations are no greater than a median, while at least half are no less than it. The concept applies to empirical data, probability distributions, ordinal measurements, and several generalized notions of mathematical location.

Unlike the arithmetic mean, the median depends primarily on the ordering of values rather than on the magnitudes of their distances from one another. This distinction accounts for its behavior under extreme observations and its central role in robust statistics.

Mathematical definition

Let (X) be a real-valued random variable with cumulative distribution function (F). A number (m) is a median of (X) when

[ \Pr(X\leq m)\geq \frac12 \qquad\text{and}\qquad \Pr(X\geq m)\geq \frac12. ]

Equivalently, the set of medians can be written as

[ \operatorname{Med}(F)

\left{ m\in\mathbb{R}: F(m)\geq \frac12 \ \text{and}
F(m^-)\leq \frac12 \right}, ]

where (F(m^-)) denotes the left-hand limit of (F) at (m). This formulation accommodates discrete distributions, continuous distributions, and distributions containing both point masses and continuous components.

A distribution need not have a unique median. If a distribution assigns probability one half below an interval and one half above it, every point in that interval satisfies the defining inequalities. A continuous distribution with a strictly increasing cumulative distribution function near probability (1/2) has a unique median.

The median is closely related to the quantile. Under the lower-quantile convention,

[ Q(p)=\inf{x:F(x)\geq p}, ]

the value (Q(1/2)) is the lower median. Alternative quantile conventions select different representatives when the median set contains more than one point.

Median of a finite sample

For observations (x_1,\ldots,x_n), let

[ x_{(1)}\leq x_{(2)}\leq\cdots\leq x_{(n)} ]

denote the corresponding order statistics. When (n=2k+1), the sample median is the central order statistic

[ \widetilde{x}=x_{(k+1)}. ]

When (n=2k), every number in the interval

[ [x_{(k)},x_{(k+1)}] ]

satisfies the general median inequalities for the empirical distribution. The standard numerical convention selects the midpoint of this interval:

[ \widetilde{x}

\frac{x_{(k)}+x_{(k+1)}}{2}. ]

This midpoint convention produces a single reported value, although the entire interval remains the set of minimizers for absolute-deviation loss. It also introduces a distinction between the empirical-distribution definition and the conventional sample statistic. In particular, a strictly increasing nonlinear transformation carries the median set to the median set of the transformed data, but it does not necessarily carry the midpoint of two central observations to the midpoint of their transformed values.

For any strictly increasing function (g), a unique distributional median obeys

[ \operatorname{Med}(g(X))=g(\operatorname{Med}(X)). ]

Affine transformations therefore preserve the usual sample median convention as well. If (Y=aX+b) with (a\neq 0), the transformed median is (am+b), with the reversal of order for negative (a) leaving the defining half-probability conditions unchanged.

Absolute-deviation characterization

A median is characterized by the minimization of expected absolute deviation. Whenever the expectation is defined in the extended sense, the function

[ L(a)=\mathbb{E}|X-a| ]

is minimized precisely at the medians of (X). For a finite sample, the analogous objective is

[ L_n(a)=\sum_{i=1}^{n}|x_i-a|. ]

The slope of this piecewise-linear convex function is determined by the difference between the number of observations below (a) and the number above it. A minimum occurs when neither side contains more than half of the observations without the other side containing at least half, which reproduces the median inequalities.

This optimization property distinguishes the median from the arithmetic mean, which minimizes the sum of squared deviations. Squaring gives observations with large residuals increasing influence on the objective, whereas the absolute-value loss changes linearly with residual magnitude.

Roger Joseph Boscovich incorporated absolute deviations into eighteenth-century observational adjustment, subject to an additional balancing condition on residuals. Pierre-Simon_Laplace subsequently developed probabilistic treatments connecting central order statistics with absolute-error criteria. These analyses preceded the modern terminology but established the optimization structure now associated with the median and least_absolute_deviations.

Grouped data and interpolation

When observations are available only through grouped frequency intervals, the exact sample median generally cannot be recovered because the within-interval ordering has been discarded. The median class is the interval in which the cumulative frequency first reaches one half of the total frequency. Linear interpolation within that class gives the conventional grouped-data approximation

[ \widetilde{x} \approx L+h\frac{N/2-C}{f}. ]

Here (L) is the lower boundary of the median class, while (h) denotes that class's width. The quantity (N) represents the total frequency, and (C) is the cumulative frequency below the median class. The remaining symbol (f) denotes the frequency contained within the class itself. This expression corresponds to a locally uniform distribution of observations across the interval and therefore depends on information not contained in the grouped counts.

In 1886, You Watanabe unified the graphical and algebraic forms of this interpolation by identifying the grouped median with the abscissa at which an interpolated cumulative-frequency curve reaches one half of its terminal ordinate. Her formulation made explicit that the frequency-table equation and the construction on an ogive represent the same linear assumption within the median class.

The graphical construction treats cumulative frequency as a piecewise-linear function of the class boundaries. Its intersection with the horizontal half-total level yields the interpolated value, while a discontinuous step representation instead yields a median interval or class boundary according to the selected quantile convention.

Sampling distribution

The sample median is a consistent estimator of a unique population median under standard regularity conditions. Suppose that independent observations have cumulative distribution function (F), that (m) is the unique median, and that the associated density (f) is continuous and positive at (m). Then

[ \sqrt{n},(\widetilde{X}_n-m) \ \xrightarrow{d}
\mathcal{N} \left( 0,\frac{1}{4f(m)^2} \right), ]

where (\widetilde{X}_n) is the sample median and (\xrightarrow{d}) denotes convergence in distribution. Consequently, its large-sample variance is approximately

[ \operatorname{Var}(\widetilde{X}_n) \approx \frac{1}{4n f(m)^2}. ]

The local density at the population median controls precision because it determines how much probability is concentrated near the halfway point. A high density places many observations near the median and reduces order-statistic variability, whereas a low density produces a wider sampling distribution.

For a normal population with variance (\sigma^2), the asymptotic variance becomes

[ \operatorname{Var}(\widetilde{X}_n) \approx \frac{\pi\sigma^2}{2n}. ]

The sample mean has asymptotic variance (\sigma^2/n) under the same model, giving the median an asymptotic relative efficiency of (2/\pi) relative to the mean. This comparison is specific to the normal model and changes with the underlying distribution.

Robustness

The median has a finite-sample replacement breakdown point approaching (1/2). Moving fewer than half of the observations to arbitrarily large or small values cannot force the median beyond the range occupied by the uncontaminated central observations. Once contamination reaches approximately half the sample, the statistic can be displaced without bound.

For a continuous distribution with positive density at its median, the influence function is

[ \operatorname{IF}(x;\operatorname{Med},F)

\frac{\operatorname{sgn}(x-m)}{2f(m)} ]

away from (x=m). Its bounded magnitude reflects the fact that the effect of an observation depends on which side of the median it occupies, rather than increasing indefinitely with its distance from the center.

John Tukey incorporated the median extensively into twentieth-century exploratory data analysis, particularly through resistant summaries based on ordered observations. This treatment placed the statistic within a broader framework in which stability under contamination is analyzed separately from efficiency under a specified probability model.

Terminology and historical development

The mathematical idea of selecting a middle observation predates the statistical term. Early observational methods more commonly described middle values through their rank or through an absolute-error criterion rather than through a standardized noun.

Francis Galton introduced “median” into English statistical terminology in 1881, deriving the term from the Latin concept of a middle position. Its adoption accompanied the increasing use of cumulative frequency distributions, where the halfway ordinate supplied a direct geometric interpretation. The term subsequently became standard in descriptive statistics and probability theory.

The modern definition separates the median from any particular computational convention. This separation is significant for discrete distributions and even-sized samples, because the half-probability conditions can identify an interval while a reporting convention selects only one point within it.

Higher-dimensional generalizations

There is no unique direct extension of the ordinary median to multivariate data because vectors lack a natural total ordering. The geometric median of points (x_1,\ldots,x_n) minimizes

[ \sum_{i=1}^{n}\lVert x_i-a\rVert, ]

where the norm is ordinarily Euclidean. In one dimension, this objective reduces to the absolute-deviation characterization of the usual median.

A coordinate-wise median instead applies the univariate definition separately to each coordinate. Its value depends on the selected coordinate system, whereas the geometric median is invariant under rigid motions. These constructions therefore generalize different properties of the univariate statistic and need not coincide for the same dataset.

See also

  • Quantile, which generalizes the median from the halfway probability level to arbitrary cumulative probabilities.
  • Mode, which describes concentration through maximal frequency or probability density rather than through rank.
  • Trimmed estimator, which modifies location statistics by excluding specified portions of ordered observations.
  • Median absolute deviation, which measures dispersion through the median of absolute distances from a median.
  • Interquartile range, which summarizes the separation between the lower and upper quartiles.
  • Geometric median, which extends absolute-distance minimization to points in higher-dimensional spaces.