1 Definition
The median is a measure of central tendency that identifies the middle position in an ordered dataset. Once the observations are arranged from smallest to largest, the median separates the lower half of the values from the upper half. Because it depends on rank rather than magnitude, it provides a simple description of the center of a distribution.
1.1 Ordered data and the middle value
To determine the median, the data must first be placed in numerical order. The central observation, or the point midway through the list, is then taken as the representative middle value. This makes the median a positional statistic rather than a value derived from all observations in the same way as the arithmetic mean.
1.2 Median for odd-sized datasets
When a dataset contains an odd number of observations, there is one exact middle value. In that case, the median is the observation with the same number of values above and below it in the ordered list. This definition is straightforward and does not require averaging.
1.3 Median for even-sized datasets
When a dataset has an even number of observations, there are two central values rather than one. The most common convention defines the median as the average of those two middle values. This yields a single number that lies between the central pair and preserves continuity across sample sizes.
1.4 Alternative conventions
Some contexts use alternative definitions for even-sized datasets, such as selecting the lower of the two central values or the upper of the two. These conventions are especially relevant in discrete data, ranking systems, or computational settings where a value already present in the dataset is preferred. The choice of convention should be stated clearly when results are reported.
2 Calculation
Calculating the median is usually a direct process, though the exact method depends on whether the data are raw, grouped, or summarized in a frequency table. The basic idea remains the same: locate the center of the ordered data and report the corresponding value or average of values.
2.1 Step-by-step procedure
The usual procedure begins by arranging the observations in ascending order. Next, the number of observations is counted. If the count is odd, the central position is identified directly; if it is even, the two central positions are located and their values are averaged. For tied values, the order still determines the middle position.
2.2 Worked examples
For the dataset 3, 7, 8, 10, 12, the ordered list has five values, so the middle value is 8 and the median is 8. For the dataset 2, 4, 6, 9, the two middle values are 4 and 6; their average is 5, so the median is 5. These examples show how the same principle applies to different sample sizes.
2.3 Median of grouped data
When data are grouped into intervals rather than listed individually, the median is estimated from the class that contains the middle observation. This often requires interpolation within the median class, using cumulative frequencies and class widths. The result is an approximation rather than an exact observed value, since the precise positions within the class are not known.
2.4 Median from frequency distributions
In a frequency distribution, each value or class is accompanied by a count. To find the median, the cumulative frequencies are examined until the central observation is reached. If the data are discrete, the median may be one of the listed values; if the data are continuous or grouped, interpolation may be used to refine the estimate.
3 Properties
The median has several important properties that make it useful in statistical description and analysis. It is especially valued for its stability in the presence of extreme observations and for its clear relationship to data ordering.
3.1 Robustness to outliers
Unlike the mean, the median is only mildly influenced by unusually large or small values. A very high income, for example, may shift the mean substantially but leave the median almost unchanged. This robustness makes the median a preferred summary for skewed data or distributions with notable extremes.
3.2 Relationship to other measures of central tendency
The median is one of the main measures of central tendency, alongside the mean and the mode. The mean reflects all values and is sensitive to numerical magnitude, while the mode identifies the most frequent value. The median lies between these ideas, emphasizing position rather than frequency or arithmetic balance.
3.3 Uniqueness and existence
A median always exists for any finite ordered dataset. In standard usage, it is unique when the number of observations is odd, and when the number is even it is typically defined by the average of the two middle values. In some discrete or ordinal settings, alternative conventions can produce more than one acceptable median-like value.
3.4 Minimization property
The median has a notable optimization property: it minimizes the sum of absolute deviations from itself. In other words, if one chooses a single value to represent a dataset and measures total distance using absolute differences, the median is the best choice. This property gives the median a natural role in robust estimation and loss functions based on absolute error.
4 Variants and related concepts
Several statistics are closely related to the median or extend its idea to different settings. These variants are useful when ordinary ranking is insufficient, when weights matter, or when a notion of geometric center is needed.
4.1 Lower median and upper median
For even-sized datasets, the lower median is the lower of the two central values, and the upper median is the higher one. These versions are sometimes used in discrete data analysis or in algorithms that require an actual observed value. They provide simpler alternatives to averaging when a midpoint between values is not appropriate.
4.2 Weighted median
The weighted median takes into account the importance or frequency of each observation. Instead of counting each value equally, each one contributes according to its weight, and the median is the point where the cumulative weight reaches half the total. This concept is widely used when observations represent different numbers of cases or different levels of reliability.
4.3 Geometric median
The geometric median generalizes the median to multiple dimensions. Rather than ordering points on a line, it finds the location that minimizes the sum of distances to all points in a plane or higher-dimensional space. It is an important concept in spatial analysis and robust multivariate estimation.
4.4 Median absolute deviation
The median absolute deviation is a measure of spread based on the median. It is computed by finding the median of the absolute differences between each observation and the median of the dataset. Because it is based on medians, it is resistant to outliers and often serves as a robust alternative to the standard deviation.
5 Applications
The median is widely used in practical settings where a typical value is needed but extreme observations could distort the summary. It appears in economics, public health, social research, and many applied sciences.
5.1 Summarizing skewed distributions
In skewed distributions, the mean may be pulled toward the long tail, while the median remains closer to the central mass of observations. This makes the median useful for reporting typical outcomes in data that are not symmetrically distributed. It is often preferred when the central location should reflect the experience of a typical case rather than the effect of exceptional values.
5.2 Household income and wages
Income and wage distributions are commonly summarized with medians because a small number of very high earners can distort averages. The median income gives a better sense of the midpoint for households or workers in a population. It is therefore widely used in reports on earnings, living standards, and economic comparison.
5.3 Real estate and prices
Property values and sale prices often vary widely, making the median a useful benchmark. A few unusually expensive properties can significantly inflate the mean, whereas the median sale price better reflects the center of the market. Similar reasoning applies to rents, transaction prices, and other price measures.
5.4 Survey and social science data
In survey research, the median is used for ordinal responses, such as ratings or satisfaction scales, where equal intervals may not be assumed. It also helps summarize variables that are unevenly distributed across respondents. In social science reporting, the median often provides a clearer description of a typical respondent than the mean.
6 Statistical inference
Beyond simple description, the median can be the subject of estimation and hypothesis-related procedures. Inference about a population median often relies on sample medians and methods that make few assumptions about the underlying distribution.
6.1 Sampling distribution of the median
The sample median varies from one sample to another, just as other statistics do. Its sampling distribution depends on sample size and the shape of the population distribution. For large samples, it often becomes more concentrated around the population median, improving precision.
6.2 Estimation of the population median
A sample median can serve as an estimator of the population median. It is consistent under broad conditions, meaning that as sample size increases, it tends to approach the true population value. This makes it a useful estimator when the distribution may not satisfy the conditions required for mean-based methods.
6.3 Confidence intervals
Confidence intervals for the median can be constructed using order statistics or resampling techniques. These intervals indicate a plausible range for the population median based on sample data. Because median-based intervals often require fewer distributional assumptions, they are especially useful in non-normal or skewed settings.
6.4 Nonparametric methods
The median is central to many nonparametric methods, which do not assume a specific probability distribution. Tests based on signs, ranks, or order statistics often use the median as a reference point. This makes the median an important tool in robust inference and distribution-free analysis.
7 Computation
Computing the median ranges from simple manual sorting to specialized algorithms for large datasets. The method chosen depends on data size, storage format, and the need for speed or precision.
7.1 Sorting-based algorithms
The most direct method is to sort the data and inspect the middle position. This approach is simple and reliable, though sorting can be computationally expensive for very large datasets. For small or moderate data collections, it remains practical and easy to implement.
7.2 Selection algorithms
Selection algorithms find the middle value without fully sorting the entire dataset. These methods can be more efficient than complete sorting, especially when only the median is needed. They are commonly used in computer science to reduce processing time for large arrays or streams of data.
7.3 Approximate median in large datasets
In massive datasets or data streams, exact calculation may be costly, so approximate methods are often used. These techniques estimate the median using summaries, samples, or incremental updates. Approximation is especially useful in real-time systems or distributed computing environments where full storage of all values is impractical.
7.4 Median in software and programming languages
Most statistical software and general-purpose programming languages include built-in functions for the median. These tools usually handle even-sized datasets by averaging the middle values, though some allow alternative options. Users should check the function’s definition carefully, particularly when working with missing values or custom data types.
8 Interpretation and limitations
The median is a useful descriptive statistic, but its meaning depends on the nature of the data and the purpose of the analysis. Like any summary measure, it has limits and should be interpreted with attention to context.
8.1 Comparison with the mean
The median and the mean can tell different stories about the same dataset. When the distribution is symmetric, the two values may be close, but in skewed data they can differ substantially. The mean captures overall arithmetic balance, while the median highlights the midpoint in ordered observations.
8.2 Sensitivity to data ordering and ties
The median depends on the ranking of values, not on their exact spacing. Tied values can make the middle region less distinct, especially in small samples or discrete data. Even so, the median remains well defined under standard conventions, provided the ordering rules are clear.
8.3 Limitations in small samples
In small datasets, the median may change considerably when one observation is added or removed. Its stability improves with sample size, but limited data can make any summary statistic less reliable. Small samples also reduce the usefulness of interpolation and inference based on the median.
8.4 Misuse and common misconceptions
A common misconception is that the median always represents a “typical” case in every context. While it is often useful for skewed data, it may hide important variation, especially in multimodal or heterogeneous datasets. Another misunderstanding is that the median is inherently better than the mean; in practice, the appropriate measure depends on the data and the analytical goal.