maths.free › Statistics & Probability › Statistics › Mean, Median and Mode

Mean, Median and Mode

Calculate the mode of a dataset.

Learning Objectives

After completing this section, you should be able to:

  1. Calculate the mode of a dataset.
  2. Calculate the median of a dataset.
  3. Calculate the mean of a dataset.
  4. Contrast measures of central tendency to identify the most representative average.
  5. Solve application problems involving mean, median, and mode.

The Mode

In our discussion of average heights, the first possible definition we offered was the height that more people share than any other. This is the mode, or the value that appears most often. If there are two modes, the data are bimodal.

Let’s look at some examples.

Finding the Mode Using a Stem-and-Leaf Plot

Try it.

In , we looked at a stem-and-leaf plot of the sale prices (in dollars) of a particular collectible trading card:

05 8 9
10 0 0 3 4 4 5 5 5 5 6 9 9
20 0 0 0 5 5 9 9
30 0 0 5 5
40 0 5
5
60

What is the mode price?

Solution

The mode is the price that appears most often. Both 15 and 20 appear 4 times, more than any other values. So, they are the modes (and we can conclude that this set of data is bimodal).

When we have a complete list of the data or a stem-and-leaf plot, it’s pretty straightforward to find the mode; we just need to find the number that appears most often. If we’re given a frequency distribution instead, the technique is different (but just as straightforward): we’re looking for the number with the highest frequency.

Finding the Mode Using a Frequency Distribution

Try it.

In , we created a frequency distribution of the number of siblings of conflict resolution class attendees.

Number of SiblingsFrequency
05
113
26
33
42
51

What is the mode of the number of siblings?

Solution

The mode is the value that appears the most often, which means it has the greatest frequency. Thirteen of the respondents have one sibling, more than any other number. So, the mode is 1.

What happens if there is no number in the data that appears more than once? In that case, by our definition, every data value is a mode. But according to some other definitions, the data would have no mode. In practice, though, it doesn’t really matter; if no data value appears more than once, then the mode is not helpful at all as a measure of centrality.

The Median

Let's revisit our example of trying to identify the height of the “average” person. If we lined everyone up in order by height and found the person right in the middle, that person’s height is called the median, or the value that is greater than no more than half and less than no more than half of the values.

Let’s look at a really simple example. Consider the following list of numbers: 11, 12, 13, 13, 14. Is the first number on the list, 11, the median? There are no values less than 11 (that’s 0%), and there are four values greater than 11 (that’s 80%). Since more than 50% of the data are greater than 11, the definition is violated; it’s not the median. Here’s a chart with the rest of the data, with red shading to show where the definition is violated:

Data ValueNumber of Values BelowPercentage of Values BelowNumber of Values AbovePercentage of Values Above
1100%480%
12120%360%
13240%120%
14480%00%

Only 13 has no violations, so it’s the median according to the definition. In practice, we find the median just like we described in the average height example: by lining up all the data values in order from smallest to largest and picking the value in the middle. For our easy example (with data values 11, 12, 13, 13, 14), that first 13 is right in the middle; there are two values to the left and two values to the right. If there’s not one value right in the middle, we pick the two closest, then choose the number exactly between them. For example, let’s say we have the data 41, 44, 46, 53. Since there are an even number of data values in our list, we can’t pick the one right in the middle. The two closest to the middle are 44 and 46, so we’ll choose the number halfway between those to be the median: 45. As this example shows, the median (unlike the mode) doesn’t have to be a number in our original set of data.

In the examples we’ve looked at so far, it’s been pretty easy to identify which number is right in the middle. If we had a very large dataset, though, it might be harder. Fortunately, we have some formulas to help us with that.

Let’s put those formulas to work in an example.

Now, let’s tackle an example with an even number of values.

Condensed: the full section is in OpenStax Contemporary Mathematics.

The Mean

Recall our example of ways we could identify the “average” height of an individual. The last method we discussed was also the most complicated. It involved a game where the player guesses a height, then figures out how far off that guess is from every single person’s height. Those differences get squared and added together to get a score. Our next measure of centrality gives the lowest possible score: No other guess would beat it in the game. Given a dataset containing n total values, the mean of the dataset is the sum of all the data values, divided by n.

This is a computation you have likely done before. In many places, including spreadsheet programs like Microsoft Excel and Google Sheets, this number is called the average. For statisticians, though, the word average has too many possible meanings, so they prefer the one we’ll use: mean.

Finding the Mean

Try it.

Compute the mean of the numbers 12, 15, 17, 18, 18, and 19.

Solution

The mean is the sum of the values, divided by the number of values on the list. So, we get: \[\frac{12+15+17+18+18+19}{6}=\frac{99}{6}=16.5.\]

Finding the Mean Using a Frequency Distribution

Try it.

Refer again to the frequency distribution of the number of siblings people who attended a conflict resolution class reported:

Number of SiblingsFrequency
05
113
26
33
42
51

What is the mean of the number of siblings?

Solution

Step 1: We compute the mean by adding up all the data values and then dividing by the number of data values on the list.

Step 2: Adding up the frequencies, we get \(5+13+6+3+2+1=30\) data values in our list.

Step 3: Now, to find the sum of all the data values, we could simply reconstruct the raw data and add up all the numbers there. But, there’s an easier way: Remember that repeatedly adding a number to itself is the definition of multiplication. So, for example, since there are six 2s in our data, the sum of all those 2s must be \(6\times 2=12\).

Step 4: Let’s add a column to our distribution for these products:

Number of SiblingsFrequency(Number of Siblings) \(\times\) (Frequency)
050
11313
2612
339
428
515

Step 5: So, the sum of all our data values is \(0+13+12+9+8+5=47\). The mean is \(\frac{47}{30}\approx 1.567\).

As the number of data values we are considering grows, the computation for the mean gets more and more complicated. That’s why people generally trust technology to perform that computation.

Note that a recent update to Google Sheets introduced a new function called “MODE.MULT,” which will find every mode (not just the first one on the list).

Condensed: the full section is in OpenStax Contemporary Mathematics.

Which Is Better: Mode, Median, or Mean?

If the mode, median, and mean all purport to measure the same thing (centrality), why do we need all three? The answer is complicated, as each measure has its own strengths and weaknesses. The mode is simple to compute, but there may be more than one. Further, if no data value appears more than once, the mode is entirely unhelpful. As for the mean and median, the main difference between these two measures is how each is affected by extreme values.

Consider this example: the mean and median of 1, 2, 3, 4, 5 are both 3. But what if the dataset is instead 1, 2, 3, 4, 10? The median is still 3, but the mean is now 4. What this example shows is that the mean is sensitive to extreme values, while the median isn’t. This knowledge can help us decide which of the two is more relevant for a given dataset. If it is important that the really high or really low values are reflected in the measure of centrality, then the mean is the better option. If very high or low values are not important, however, then we should stick with the median.

The decision between mean and median only really matters if the data are skewed. If the data are symmetric, then the mean and median are going to be approximately equal, and the distinction between them is irrelevant. If the data are skewed, the mean gets pulled in the direction of the skew (i.e., if the data are right-skewed, then the mean will be bigger than the median; if the data are left-skewed, the opposite relation is true).

Condensed: the full section is in OpenStax Contemporary Mathematics.

Key Concepts

  • The mode of a dataset is the value that appears the most frequently. The median is a value that is greater than or equal to no more than 50% of the data and less than or equal to no more than 50% of the data. The mean is the sum of all the data values, divided by the number of units in the dataset.
  • The median of a dataset is not affected by outliers, but the mean will be biased toward outliers. This distinction might affect which measure of centrality is used to summarize a dataset.

Formulas

Suppose we have a set of data with \(n\) values, ordered from smallest to largest. If \(n\) is odd, then the median is the data value at position \(\frac{n+1}{2}\). If \(n\) is even, then we find the values at positions \(\frac{n}{2}\) and \(\frac{n}{2}+1\). If those values are named \(a\) and \(b\), then the median is defined to be \(\frac{a+b}{2}\).

现在轮到你 没有计算器能解决这一个问题, 但其中的碎片是可以计算的。 请在下面尝试一个, 或者输入您自己的 。

实践 (9)

先在纸上试一个。 将答案显示为检查; 校验的答案可以在求解器中打开, 每一步都可用 。

  1. In , we looked at a stem-and-leaf plot of the sale prices (in dollars) of a particular collectible trading card:

    05 8 9
    10 0 0 3 4 4 5 5 5 5 6 9 9
    20 0 0 0 5 5 9 9
    30 0 0 5 5
    40 0 5
    5
    60

    What is the mode price?

    发送答案

    The mode is the price that appears most often. Both 15 and 20 appear 4 times, more than any other values. So, they are the modes (and we can conclude that this set of data is bimodal).

  2. In , we created a frequency distribution of the number of siblings of conflict resolution class attendees.

    Number of SiblingsFrequency
    05
    113
    26
    33
    42
    51

    What is the mode of the number of siblings?

    发送答案

    The mode is the value that appears the most often, which means it has the greatest frequency. Thirteen of the respondents have one sibling, more than any other number. So, the mode is 1.

  3. In , we looked at a stem-and-leaf plot that contained 33 sale prices (in dollars) of a particular collectible trading card:

    05 8 9
    10 0 0 3 4 4 5 5 5 5 6 9 9
    20 0 0 0 5 5 9 9
    30 0 0 5 5
    40 0 5
    5
    60

    What is the median price?

    发送答案

    Step 1: Since 33 is odd, the median is the data value at position \(\frac{n+1}{2}\), where \(n\) is the number of values in the dataset. There are 33 total values, so our formula becomes \(\frac{33+1}{2}=17\). That means we want to look for the 17th number in the dataset.

    Step 2: We'll want to count from the lowest value to the 17th number. We can use our stem and leaf plot to do this.

    1 2 3
    05 8 9
    4 5 6 7 8 9 10 11 12 13 14 15 16
    10 0 0 3 4 4 5 5 5 5 6 9 9
    17
    20 0 0 0 5 5 9 9
    30 0 0 5 5
    40 0 5
    5
    60

    The seventeenth number is 20, so the median is 20.

  4. In , we looked at the number of times different crickets (of differing species, genders, etc.) chirped in a one-minute span. That data is again provided below:

    8997821028499
    1151058910910789
    10110911610310091
    931031209185104
    1048210692104106

    Find the median.

    发送答案

    Step 1: In order to find the median, we first need to sort the data so that they’re in order, smallest to largest:

    828284858989
    899191929397
    99100101102103103
    104104104105106106
    107109109115116120

    Step 2: Next, we figure out how many data values we have. Counting them up, we see there are 30, which is even.

    Step 3: Since we have an even number of data values, we need to find the values in positions \(\frac{30}{2}=15\) and \(\frac{30}{2}+1=16\). These are 101 and 102.

    Step 4: We use the formula to compute the median: \(\frac{101+102}{2}=101.5\).

  5. In , we created a frequency distribution of the number of siblings of the people who attended a conflict resolution class. Let's review that data again:

    Number of SiblingsFrequency
    05
    113
    26
    33
    42
    51

    What is the median of the number of siblings?

    发送答案

    There are 30 data values total, so the median is between the 15th and 16th values in the ordered list. There are five 0s and thirteen 1s according to the frequency distribution, so items one through five are all 0s and items six through eighteen are all 1s. Since both items fifteen and sixteen are 1s, the median is 1.

  6. Compute the mean of the numbers 12, 15, 17, 18, 18, and 19.

    发送答案

    The mean is the sum of the values, divided by the number of values on the list. So, we get: \[\frac{12+15+17+18+18+19}{6}=\frac{99}{6}=16.5.\]

  7. Refer again to the frequency distribution of the number of siblings people who attended a conflict resolution class reported:

    Number of SiblingsFrequency
    05
    113
    26
    33
    42
    51

    What is the mean of the number of siblings?

    发送答案

    Step 1: We compute the mean by adding up all the data values and then dividing by the number of data values on the list.

    Step 2: Adding up the frequencies, we get \(5+13+6+3+2+1=30\) data values in our list.

    Step 3: Now, to find the sum of all the data values, we could simply reconstruct the raw data and add up all the numbers there. But, there’s an easier way: Remember that repeatedly adding a number to itself is the definition of multiplication. So, for example, since there are six 2s in our data, the sum of all those 2s must be \(6\times 2=12\).

    Step 4: Let’s add a column to our distribution for these products:

    Number of SiblingsFrequency(Number of Siblings) \(\times\) (Frequency)
    050
    11313
    2612
    339
    428
    515

    Step 5: So, the sum of all our data values is \(0+13+12+9+8+5=47\). The mean is \(\frac{47}{30}\approx 1.567\).

  8. The dataset "InState" contains the in-state tuitions of every college and university in the country that reported that data to the Department of Education. Find the mode, median, and mean of those in-state tuition values.

    发送答案

    Step 1: To find the mode, we select an empty cell type “=MODE(”, click on the header of the column to insert a reference to the column into our formula, and then close the parentheses. When we hit the enter key, our formula is replaced with the mode: $13,380.

    Step 2: We can find the median and mean using the same process, except using the functions “MEDIAN” and “AVERAGE” in place of “MODE”. We find that the median is $11,207 and the mean is $15,476.79.

  9. For the following situations, decide which measure(s) of centrality would be best:

    1. You found a used car that you like, and you want to know if the price is too high or too low. You find a list of sale prices for that make and model, and you see that the distribution of those prices is skewed to the right. Some of the prices at the high end are close to the original sale price of the car, so you guess that those cars might have really low mileage, or have other enhancements added on that increased the value (but which don’t apply to the car you found).
    2. You are asked to analyze the responses to a survey. One of the questions asked, “How strongly do you agree with the statement, ‘I believe my elected representatives have my best interests in mind when they vote’?” Responses are a number between 1 and 5, with 1 representing “strongly disagree” and 5 representing “strongly agree.”
    3. You are asked to find the “average” household income for a zip code. Those values are skewed right.
    4. Thinking back to the situation at the beginning of this section: you want to find “average” height. The data you’ve collected seem to be distributed symmetrically.

    发送答案

    1. In this situation, the high values are not comparable to the value of the car you found and we don’t want them to affect the results. Also, we’re unlikely to find many repeated values, so the mode is probably not useful. Median is best.
    2. Here, we want to know what a typical result is. The mean doesn’t really make sense; it involves adding the numbers together, so it would treat two “strongly disagree” and two “strongly agree” responses (those add to \(1+1+5+5=12\)) as exactly the same as four “neutral” responses (\(3+3+3+3=12\)). But those are really different situations; the first shows a strong polarization in the responses, while the second represents strong indifference. The mode is probably the best choice (because the data are actually categorical), but the median would be good too.
    3. The mode isn’t going to be useful in this situation because it’s unlikely you will find many households that have exactly the same income. The mean and median will be different because of the skew, so the choice comes down to the extreme values. Remember that the data are skewed right, so high values are prevalent. Because these high values are important for our analysis, we want them to be reflected in the results. Thus, the mean is best. That being said, the median is also useful; it allows us to say something like “50% of the households surveyed make more than” the median.
    4. Because we aren’t likely to find many people with exactly the same height, the mode won’t be useful. Since the data are symmetric, the mean and the median will be about the same. So, it doesn’t really matter which of those two we choose.

保持你自己的工作

免费账户在每一课上都添加注解, 记录你完成的, 在一个地方解决的, 以及您可以询问的关于此页的导师。 数学本身向每个人开放, 是否签名 。

签名上签名 登录

此处所用符号

输入完整定义、图片和其中每个字母的含义的符号。

如何: Mean, Median and Mode

  1. Calculate the mode of a dataset.
  2. Calculate the median of a dataset.
  3. Calculate the mean of a dataset.
  4. Contrast measures of central tendency to identify the most representative average.
  5. Solve application problems involving mean, median, and mode.
  6. You found a used car that you like, and you want to know if the price is too high or too low. You find a list of sale prices for that make and model, and you see that the distribution of those prices is skewed to the right. Some of the prices at the high end are close to the original sale price of the car, so you guess that those cars might have really low mileage, or have other enhancements added on that increased the value (but which don’t apply to the car you found).
  7. You are asked to analyze the responses to a survey. One of the questions asked, “How strongly do you agree with the statement, ‘I believe my elected representatives have my best interests in mind when they vote’?” Responses are a number between 1 and 5, with 1 representing “strongly disagree” and 5 representing “strongly agree.”
  8. You are asked to find the “average” household income for a zip code. Those values are skewed right.

人们对人们提出的问题

Mean or median, which should I use?

Median when the data have outliers or a long tail (incomes, house prices); mean when the data are roughly symmetric and you want every value to count. Report both if they disagree. The gap is itself information.

What does a p-value actually say?

The probability of seeing data at least this extreme if the null hypothesis were true. It is not the probability that the null hypothesis is true.

Why divide by n − 1 for the sample variance?

The sample mean sits closer to the sample than the true mean does, so squared deviations from it are slightly too small on average; dividing by n − 1 instead of n corrects the bias.

本页部分内容从 OpenStax Contemporary Mathematics (CC BY-NC-SA 4.0). 在这里进行浓缩和重新解释;错误属于我们。 由于其来源是非商业性用途许可证,这一课程是免费的,不出售任何物品,根据同一许可证分享。

更多 Statistics & Probability