Median


Article Author:
Steven Tenny


Article Editor:
Mary Hoffman


Editors In Chief:
Iryna Filippava
Lance Wilcox


Managing Editors:
Avais Raja
Orawan Chaigasame
Carrie Smith
Abdul Waheed
Khalid Alsayouri
Trevor Nezwek
Radia Jamil
Patrick Le
Anoosh Zafar Gondal
Saad Nazir
William Gossman
Hassam Zulfiqar
Steve Bhimji
John Shell
Matthew Varacallo
Heba Mahdy
Ahmad Malik
Sarosh Vaqar
Mark Pellegrini
James Hughes
Beata Beatty
Nazia Sadiq
Hajira Basit
Phillip Hynes
Tehmina Warsi


Updated:
4/28/2019 12:26:58 AM

Introduction

The median is the middle value of a set of numbers. The median is the same as the 50th percentile for the set of numbers. In other words, the median is the middle of a set of numbers with half of the values less than the median and half the values greater than the median.[1][2][3][4]

A short example will help clarify this point. Take the set of seven numbers (8, 6, 9, 5, 8, 23, 4). To find the median we first sort the numbers from lowest to highest (in ascending order). The numbers sorted are (4, 5, 6, 8, 8, 9, 23). The median is then the middle number. As there are seven numbers in the set, the fourth number is the median which is '8' in our example. Note the median is different from the mean. The mean is the "average" value in the set which would be 9 as calculated by:

What does one do if there is an even set of numbers? Then the median is the average of the two middle numbers. Use the second set of numbers to show this principle. The second set of numbers is (7, 3, 10, 2, 9, 2, 1, 4). Then, order the set of numbers and get (1, 2, 2, 3, 4, 7, 9, 10). The second set of numbers has eight numbers in it with the two middle numbers being 3 and 4. The median would then be the average of these two numbers or 3.5 (calculated as (3+4)/2 =  3.5). Note this median of 3.5 is again different than the mean or average of the set of numbers which 4.75 as calculated by:

Function

Start with a set of numbers with a total of n members. That is there are n numbers in our set of numbers. Once the set of numbers is sorted (either ascending or descending) then the median can be calculated as follows:[1][2]

For sets with an odd number of members, n is odd:

  • Median = value of the ((n+1)/2)th item in the sorted set

For sets with an even number of members, n is even:

  • Median = value of the [(n/2)th item + (n/2 + 1)th item] / 2 in the sorted set

Use our simple sets from above to work an example for both cases.

For a set where n is odd, we use or first set (8, 6, 9, 5, 8, 23, 4). 

The set once sorted is (4, 5, 6, 8, 8, 9, 23). 

In this set n = 7.

  • Median = value of the ((n+1)/2)th item in the sorted set 

  •  = value of ((7+1)/2)th item in sorted set

  • = value of ((8)/2)th item in sorted set

  • = value of 4th item in sorted set

For a set where n is even, use the second set (7, 3, 10, 2, 9, 2, 1, 4).

The set once sorted is (1, 2, 2, 3, 4, 7, 9, 10).

In this set n = 8.

  • Median =  value of the [(n/2)th item + (n/2 + 1)th item] / 2 in the sorted set

  • = value of the [(8/2)th item + (8/2 + 1)th item] / 2 in the sorted set

  • = value of the [4th item + (4+1)th item] / 2 in the sorted set

  • = value of the [ 4th item + 5th item] / 2 in the sorted set = value of [3 + 4] / 2

  • = value of [7] / 2

  • = 3.5

Issues of Concern

The most common mistake is distinguishing between the mean, median, and mode. The mean is the "average" of the numbers in the set. The simple mean is calculated by adding all of the numbers in the set together then dividing by the number of items in the set.[1]

The median is the topic of this discussion and is calculated as stated above in the function section.

The mode is the most common element in the set or the value that happens the most often. In the first data set (4, 5, 6, 8, 8, 9, 23), the number 8 occurs twice which is more common than any of the other numbers, so the mode of the data set is 8. One can have more than one mode as well as no mode for a dataset. In the data set (2, 3, 3, 5, 5, 7, 7) there are three modes as 3, 5 and seven all appear twice which is more than two which only appears once. This dataset would be said to be trimodal. If there were two modes, the dataset would be bimodal, and if there were more than three modes to the dataset, then the dataset would be multimodal. In a different dataset of (6, 7, 8, 9) no number appears more frequently than the others, so there is no mode to the data set.

Clinical Significance

The median is a commonly reported number in the scientific literature for a good reason. Many times in science and medicine we are interested in the time to a certain event, such as decay time of a radioisotope or survival time of a patient with specific cancer. If we start out with 11 radioisotopes with decay times of (1, 1, 1, 2, 4, 5, 5, 5, 6, 11, 41) seconds then within one minute we can calculate both the median of 5 seconds, which is the middle value of the set, as well as the mean of 7.45 seconds.

If however the same dataset of {1, 1, 1, 2, 4, 5, 5, 5, 6, 11, 41} represents survival in years for patients with specific cancer the median may be more useful. We can calculate the median after the sixth patient passes away from cancer at 5 years as half of the patients have died and half are still living. To calculate the mean, we must have the total survival of all patients. Thus we have to wait 41 years for the final patient to die before we can calculate the mean. Waiting for the event to occur in all patients to allow us to calculate the mean thus becomes a lengthy process and makes the median a more palatable number to calculate.

A second desirable characteristic of the median versus the mean is that the median is less affected by outliers or extreme values. If we return to our dataset of (1, 1, 1, 2, 4, 5, 5, 5, 6, 11, 41), we can see that 41 seems to be well away from the mean of 7.45 of the dataset.  If we eliminate this outlier, we can get a new dataset of (1, 1, 1, 2, 4, 5, 5, 5, 6, 11) with a median of 4.5 and mean of 4.1. We see that the median only changed by 10% (went down to 4.5 from 5) while the mean decreased by 45% (went down to 4.1 from 7.45). Thus the median may be a better indicator of the realistic middle of the data compared to the mean in skewed data. Skewed data is any data set where there are one or more outliers or values at either the extreme high or extreme low end of the dataset.

If we go back to our dataset of (1, 1, 1, 2, 4, 5, 5, 5, 6, 11, 41) for years of survival for patients with a specific cancer is it more realistic to report the median survival is 5 years, that is that half of patients are no longer alive at 5 years? Or, is it better to report mean survival is 7.45 years, that is on average for our 11 patients they lived 7.45 years? With the mean, we should note only two lived longer than the mean. We may all want to be the outlier in this example, living 41 years, but this may not provide a realistic picture of the data.

Other Issues

Although median provides a measure of the middle of the data it may not always be the best measure. Sometimes the mean may be the more desirable attribute to have. Statistical analysis tends to be more robust and may be simpler to compute with the mean value.

There are cases where neither the median nor the mean is a good measure of the middle of the data. The median and mean are better measures when the data has one prominent peak, that is it is unimodal. When the data has two or more prominent peaks (e.g., bimodal, trimodal, multimodal), then the median may not provide the best information. Imagine a curve that looks like two hills on either side of a valley with a bump on the left of the data at the small values and a second bump at the right of the data with large values (a bimodal dataset). The median may mathematically be in the valley if this is where the middle value is, but the median, in this case, may fail to provide the information we find useful, namely where the peaks are and the data clusters.


Interested in Participating?

We are looking for contributors to author, edit, and peer review our vast library of review articles and multiple choice questions. In as little as 2-3 hours you can make a significant contribution to your specialty. In return for a small amount of your time, you will receive free access to all content and you will be published as an author or editor in eBooks, apps, online CME/CE activities, and an online Learning Management System for students, teachers, and program directors that allows access to review materials in over 500 specialties.

Improve Content - Become an Author or Editor

This is an academic project designed to provide inexpensive peer-reviewed Apps, eBooks, and very soon an online CME/CE system to help students identify weaknesses and improve knowledge. We would like you to consider being an author or editor. Please click here to learn more. Thank you for you for your interest, the StatPearls Publishing Editorial Team.

Median - Questions

Take a quiz of the questions on this article.

Take Quiz
What is the median in a sample of 1, 4, 5, 5, and 5?



Click Your Answer Below


Would you like to access teaching points and more information on this topic?

Improve Content - Become an Author or Editor and get free access to the entire database, free eBooks, as well as free CME/CE as it becomes available. If interested, please click on "Sign Up" to register.

Purchase- Want immediate access to questions, answers, and teaching points? They can be purchased above at Apps and eBooks.


Sign Up
What is the median of the following numbers: 1, 2, 2, 3, 7?



Click Your Answer Below


Would you like to access teaching points and more information on this topic?

Improve Content - Become an Author or Editor and get free access to the entire database, free eBooks, as well as free CME/CE as it becomes available. If interested, please click on "Sign Up" to register.

Purchase- Want immediate access to questions, answers, and teaching points? They can be purchased above at Apps and eBooks.


Sign Up
A dataset has one very extreme outlier. Which of the following is least affected by the outlier?



Click Your Answer Below


Would you like to access teaching points and more information on this topic?

Improve Content - Become an Author or Editor and get free access to the entire database, free eBooks, as well as free CME/CE as it becomes available. If interested, please click on "Sign Up" to register.

Purchase- Want immediate access to questions, answers, and teaching points? They can be purchased above at Apps and eBooks.


Sign Up
Which of the following is the best definition of median?



Click Your Answer Below


Would you like to access teaching points and more information on this topic?

Improve Content - Become an Author or Editor and get free access to the entire database, free eBooks, as well as free CME/CE as it becomes available. If interested, please click on "Sign Up" to register.

Purchase- Want immediate access to questions, answers, and teaching points? They can be purchased above at Apps and eBooks.


Sign Up

Median - References

References

Descriptive Statistics: Reporting the Answers to the 5 Basic Questions of Who, What, Why, When, Where, and a Sixth, So What?, Vetter TR,, Anesthesia and analgesia, 2017 Nov     [PubMed]
Statistics for the nonstatistician: Part II., Hou W,Carden D,, Southern medical journal, 2012 Mar     [PubMed]
Statistics for the nonstatistician: Part I., Wissing DR,Timm D,, Southern medical journal, 2012 Mar     [PubMed]
Whitley E,Ball J, Statistics review 1: presenting and summarising data. Critical care (London, England). 2002 Feb;     [PubMed]

Disclaimer

The intent of StatPearls is to provide practice questions and explanations to assist you in identifying and resolving knowledge deficits. These questions and explanations are not intended to be a source of the knowledge base of all of medicine, nor is it intended to be a board or certification review of Nurse-Calculations. The authors or editors do not warrant the information is complete or accurate. The reader is encouraged to verify each answer and explanation in several references. All drug indications and dosages should be verified before administration.

StatPearls offers the most comprehensive database of free multiple-choice questions with explanations and short review chapters ever developed. This system helps physicians, medical students, dentists, nurses, pharmacists, and allied health professionals identify education deficits and learn new concepts. StatPearls is not a board or certification review system for Nurse-Calculations, it is a learning system that you can use to help improve your knowledge base of medicine for life-long learning. StatPearls will help you identify your weaknesses so that when you are ready to study for a board or certification exam in Nurse-Calculations, you will already be prepared.

Our content is updated continuously through a multi-step peer review process that will help you be prepared and review for a thorough knowledge of Nurse-Calculations. When it is time for the Nurse-Calculations board and certification exam, you will already be ready. Besides online study quizzes, we also publish our peer-reviewed content in eBooks and mobile Apps. We also offer inexpensive CME/CE, so our content can be used to attain education credits while you study Nurse-Calculations.