Median
18837
222868106
2008-07-01T14:34:14Z
Blanchardb
5311630
Reverted edits by [[Special:Contributions/167.93.37.41|167.93.37.41]] to last version by J Hill (using [[WP:HG|Huggle]])
{{otheruses1|the statistical concept}}
In [[probability theory]] and [[statistics]], a '''median''' is described as the number separating the higher half of a sample, a population, or a [[probability distribution]], from the lower half. The ''median'' of a finite list of numbers can be found by arranging all the observations from lowest value to highest value and picking the middle one. If there is an even number of observations, the median is not unique, so one often takes the [[mean]] of the two middle values.
At most half the population have values less than the ''median'' and at most half have values greater than the median. If both groups contain less than half the population, then some of the population is exactly equal to the median. For example, if ''a'' < ''b'' < ''c'', then the median of the list {''a'', ''b'', ''c''} is ''b'', and if ''a'' < ''b'' < ''c'' < ''d'', then the median of the list {''a'', ''b'', ''c'', ''d''} is the mean of ''b'' and ''c'', i.e. it is (''b'' + ''c'')/2.
==Notation==
The median of some variable <math>x\,\!</math> is denoted either as <math>\tilde{x}\,\!</math> or as <math>\mu_{1/2}(x).\,\!</math><!--
[[Media:Example.ogg]][[Media:[[Media:Example.ogg]]]]]]</sub> http://mathworld.wolfram.com/StatisticalMedian.html -->
==Popular explanation==
''The difference between the median and the mean is illustrated in this simple example'':
Suppose 19 paupers and 1 billionaire are in a room. Everyone removes all the money from their pockets and puts it on a table. Each pauper puts $5 on the table; the billionaire puts $1 billion (i.e. $10<sup>9</sup>) there. The total is then $1,000,000,095. If that money is divided equally among the 20 people, each gets $50,000,004.75. That amount is the ''[[mean]]'' amount of money that the 20 people brought into the room. But the ''median'' amount is $5, since one may divide the group into two groups of 10 people each, and say that everyone in the first group brought in no more than $5, and each person in the second group brought in no less than $5. In a sense, the median is the amount that the ''typical'' person brought in. By contrast, the mean is not at all typical, since nobody in the room brought in an amount approximating $50,000,004.75.
==Measures of statistical dispersion==
When the ''median'' is used as a [[location parameter]] in descriptive statistics, there are several choices for a measure of variability: the [[Range (statistics)|range]], the [[interquartile range]], the mean [[absolute deviation]], and the [[median absolute deviation]]. Since the median is the same as the ''second quartile'', its calculation is illustrated in the article on [[quartile]]s.
Working with computers, a population of integers should have an integer median. Thus, for an integer population with an even number of elements, there are two medians known as ''lower median'' and ''upper median''. For floating point population, the median lies somewhere between the two middle elements, depending on the distribution.
Median is the middle most value after arranging data by any order
==Medians of probability distributions==
For any [[probability distribution]] on the [[real number|real]] line with [[cumulative distribution function]] ''F'', regardless of whether it is any kind of continuous probability distribution, in particular an [[absolute continuity|absolutely continuous distribution]] (and therefore has a [[probability density function]]), or a discrete probability distribution, a median ''m'' satisfies the inequalities
:<math>\operatorname{P}(X\leq m) \geq \frac{1}{2} \quad\and\quad \operatorname{P}(X\geq m) \geq \frac{1}{2}\,\!</math>
or
:<math>\int_{-\infty}^m \mathrm{d}F(x) \geq \frac{1}{2} \quad\and\quad \int_m^{\infty} \mathrm{d}F(x) \geq \frac{1}{2}\,\!</math>
in which a [[Riemann-Stieltjes integral]] is used. For an absolutely continuous probability distribution with [[probability density function]] ''f'', we have
:<math>\operatorname{P}(X\leq m) = \operatorname{P}(X\geq m)=\int_{-\infty}^m f(x)\, \mathrm{d}x=0.5.\,\!</math>
Medians of particular distributions: The medians of certain types of distributions can be easily estimated from their parameters: The median of a [[normal distribution]] with mean μ and variance σ<sup>2</sup> is μ. In fact, for a normal distribution, mean = median = mode. The median of a [[uniform distribution]] in the interval [''a'', ''b''] is (''a'' + ''b'') / 2, which is also the mean. The median of a [[Cauchy distribution]] with location parameter ''x''<sub>0</sub> and scale parameter ''y'' is ''x''<sub>0</sub>, the location parameter. The median of an [[exponential distribution]] with [[rate parameter]] <math>\lambda</math> is the natural log of 2 divided by the rate parameter: <math>\ln 2 /\lambda</math>. The median of a [[Weibull distribution]] with shape parameter ''k'' and scale parameter <math>\lambda</math> is <math>\lambda (\ln 2)^{1/k}</math>.
==Medians in descriptive statistics==
The median is primarily used for [[skewness|skewed]] distributions, which it represents differently than the [[arithmetic mean]]. Consider the [[multiset]] { 1, 2, 2, 2, 3, 9 }. The median is 2 in this case, as is the [[mode (statistics)|mode]], and it might be seen as a better indication of [[central tendency]] than the [[arithmetic mean]] of 3.166….
Calculation of medians is a popular technique in [[summary statistics]] and [[summarizing statistical data]], since it is simple to understand and easy to calculate, while also giving a measure that is more robust in the presence of [[outlier]] values than is the [[mean]].
==Theoretical properties==
===An optimality property===
The median is also the central point which minimizes the average of the absolute deviations; in the example above this would be (1 + 0 + 0 + 0 + 1 + 7) / 6 = 1.5 using the median, while it would be 1.944 using the mean. In the language of probability theory, the value of ''c'' that minimizes
:<math>E(\left|X-c\right|)\,</math>
is the median of the probability distribution of the [[random variable]] ''X''. Note, however, that c is not always unique, and therefore not well defined in general.
===An inequality relating means and medians===
For continuous probability distributions, the difference between the median and the mean is less than or equal to one [[standard deviation]]. See [[an inequality on location and scale parameters]].
==The sample median==
===Efficient computation of the sample median===
Even though [[sorting algorithm|sorting]] ''n'' items takes in general [[Big O notation|O]](''n'' log ''n'') operations, by using a [[divide and conquer algorithm|"divide and conquer" algorithm]] the median of ''n'' items can be computed with only [[Big O notation|O]](''n'') operations (in fact, you can always find the ''k''-th element of a list of values with this method; this is called the [[selection algorithm|selection problem]]).
===Easy explanation of the sample median===
As an example, we will calculate the median of the following population of numbers: 1, 5, 2, 8, 7.
Start by sorting the numbers: 1, 2, 5, 7, 8.
In this case, 5 is the median, because when the numbers are sorted, it is the middle number.
If there is an even amount of numbers, the median is the [[arithmetic mean]] of the two middle numbers.
As an example of this scenario, we will calculate the median of the following population of numbers: 1, 5, 2, 10, 8, 7.
Again, start by sorting the numbers: 1, 2, 5, 7, 8, 10.
In this case, 6 is the median, because when the numbers are sorted, 5 and 7 are the two middle numbers. The arithmetic mean of 5 and 7 is 6 (5 + 7 = 12, and 12/2 = 6).
==Other estimates of the median==
If data are represented by a [[statistical model]] specifying a particular family of [[probability distribution]]s, 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. See, for example [[Pareto interpolation]].
== See also ==
* [[Order statistic]]
* [[An inequality on location and scale parameters]]
* The median is the 2nd [[quartile]], 5th [[decile]], and 50th [[percentile]].
* [[Median voter theory]]
* The median in general is a [[Bias of an estimator|biased]] estimator.
* [[Median graph]]
* The [[centerpoint (geometry)|centerpoint]] is a generalization of the median for data in higher dimensions.
==External links==
* [http://www.stats4students.com/Essentials/Measures-Central-Tendency/Overview_2.php A Guide to Understanding & Calculating the Median]
* [http://economicsbulletin.vanderbilt.edu/2004/volume3/EB-04C10011A.pdf Median as a weighted arithmetic mean of all Sample Observations]
* [http://www.poorcity.richcity.org/cgi-bin/inequality.cgi On-line calculator]
* [http://www.statcan.ca/english/edu/power/ch11/median/median.htm Calculating the median]
* [http://mathschallenge.net/index.php?section=problems&show=true&titleid=average_problem A problem involving the mean, the median, and the mode.]
* [http://mathworld.wolfram.com/StatisticalMedian.html mathworld: Statistical Median]
{{planetmath|id=5900|title=Median of a distribution}}{{Statistics}}
[[Category:Means]]
[[Category:Robust statistics]]
[[ar:وسيط حسابي]]
[[bg:Медиана (статистика)]]
[[ca:Mediana]]
[[cs:Medián]]
[[da:Median]]
[[de:Median]]
[[et:Mediaan]]
[[es:Mediana (estadística)]]
[[eo:Mediano (statistiko)]]
[[eu:Mediana]]
[[fa:میانه (آمار)]]
[[fr:Médiane (centre)]]
[[gl:Mediana]]
[[hr:Mediana]]
[[is:Miðgildi]]
[[it:Mediana (statistica)]]
[[he:חציון]]
[[lt:Mediana]]
[[hu:Medián]]
[[nl:Mediaan (statistiek)]]
[[ja:中央値]]
[[no:Median]]
[[pl:Mediana]]
[[pt:Mediana (estatística)]]
[[ru:Медиана (статистика)]]
[[scn:Mediana]]
[[simple:Median]]
[[sk:Medián]]
[[sl:Mediana]]
[[sr:Медијана (статистика)]]
[[su:Median]]
[[fi:Mediaani]]
[[sv:Median]]
[[ta:இடைநிலையளவு]]
[[th:มัธยฐาน]]
[[vi:Số trung vị]]
[[tg:Медиана]]
[[tr:Medyan]]
[[zh:中位數]]