Learning Outcomes
- Calculate the mean, median, and mode of a set of data
- Calculate the range of a data set, and recognize it’s limitations in fully describing the behavior of a data set
- Calculate the standard deviation for a data set, and determine it’s units
- Identify the difference between population variance and sample variance
- Identify the quartiles for a data set, and the calculations used to define them
- Identify the parts of a five number summary for a set of data, and create a box plot using it
It is often desirable to use a few numbers to summarize a data set. One important aspect of a set of data is where its center is located. In this lesson, measures of central tendency are discussed first. A second aspect of a distribution is how spread out it is. In other words, how much the data in the distribution vary from one another. The second section of this lesson describes measures of variability.
Measures of Central Tendency
Mean, Median, and Mode
Let’s begin by trying to find the most “typical” value of a data set.
Note that we just used the word “typical” although in many cases you might think of using the word “average.” We need to be careful with the word “average” as it means different things to different people in different contexts. One of the most common uses of the word “average” is what mathematicians and statisticians call the arithmetic mean, or just plain old mean for short. “Arithmetic mean” sounds rather fancy, but you have likely calculated a mean many times without realizing it; the mean is what most people think of when they use the word “average.”
Mean
The mean of a set of data is the sum of the data values divided by the number of values.
examples
Marci’s exam scores for her last math class were 79, 86, 82, and 94. What would the mean of these values would be?
The number of touchdown (TD) passes thrown by each of the 31 teams in the National Football League in the 2000 season are shown below.
37 33 33 32 29 28 28 23 22 22 22 21 21 21 20
20 19 19 18 18 18 18 16 15 14 14 14 12 12 9 6
What is the mean number of TD passes?
Both examples are described further in the following video.
Try It
The price of a jar of peanut butter at 5 stores was $3.29, $3.59, $3.79, $3.75, and $3.99. Find the mean price.
examples
The one hundred families in a particular neighborhood are asked their annual household income, to the nearest $5 thousand dollars. The results are summarized in a frequency table below.
Income (thousands of dollars) | Frequency |
15 | 6 |
20 | 8 |
25 | 11 |
30 | 17 |
35 | 19 |
40 | 20 |
45 | 12 |
50 | 7 |
What is the mean average income in this neighborhood?
Extending off the last example, suppose a new family moves into the neighborhood example that has a household income of $5 million ($5000 thousand).
What is the new mean of this neighborhood’s income?
Both situations are explained further in this video.
While 83.1 thousand dollars ($83,069) is the correct mean household income, it no longer represents a “typical” value.
Imagine the data values on a see-saw or balance scale. The mean is the value that keeps the data in balance, like in the picture below.
If we graph our household data, the $5 million data value is so far out to the right that the mean has to adjust up to keep things in balance.
For this reason, when working with data that have outliers – values far outside the primary grouping – it is common to use a different measure of center, the median.
Median
The median of a set of data is the value in the middle when the data is in order.
- To find the median, begin by listing the data in order from smallest to largest, or largest to smallest.
- If the number of data values, N, is odd, then the median is the middle data value. This value can be found by rounding N/2 up to the next whole number.
- If the number of data values is even, there is no one middle value, so we find the mean of the two middle values (values N/2 and N/2 + 1)
example
Returning to the football touchdown data, we would start by listing the data in order. Luckily, it was already in decreasing order, so we can work with it without needing to reorder it first.
37 33 33 32 29 28 28 23 22 22 22 21 21 21 20
20 19 19 18 18 18 18 16 15 14 14 14 12 12 9 6
What is the median TD value?
Find the median of these quiz scores: 5 10 8 6 4 8 2 5 7 7
Learn more about these median examples in this video.
Try It
The price of a jar of peanut butter at 5 stores was $3.29, $3.59, $3.79, $3.75, and $3.99. Find the median price.
Example
Let us return now to our original household income data
Income (thousands of dollars) | Frequency |
15 | 6 |
20 | 8 |
25 | 11 |
30 | 17 |
35 | 19 |
40 | 20 |
45 | 12 |
50 | 7 |
What is the mean of this neighborhood’s household income?
If we add in the new neighbor with a $5 million household income, then there will be 101 data values, and the 51st value will be the median. As we discovered in the last example, the 51st value is $35 thousand. Notice that the new neighbor did not affect the median in this case. The median is not swayed as much by outliers as the mean is.
View more about the median of this neighborhood’s household incomes here.
In addition to the mean and the median, there is one other common measurement of the “typical” value of a data set: the mode.
Mode
The mode is the element of the data set that occurs most frequently.
The mode is fairly useless with data like weights or heights where there are a large number of possible values. The mode is most commonly used for categorical data, for which median and mean cannot be computed.
Example
In our vehicle color survey earlier in this section, we collected the data
Color | Frequency |
---|---|
Blue | 3 |
Green | 5 |
Red | 4 |
White | 3 |
Black | 2 |
Grey | 3 |
Which color is the mode?
Mode in this example is explained by the video here.
It is possible for a data set to have more than one mode if several categories have the same frequency, or no modes if each every category occurs only once.
Try It
Reviewers were asked to rate a product on a scale of 1 to 5. Find
- The mean rating
- The median rating
- The mode rating
Rating | Frequency |
1 | 4 |
2 | 8 |
3 | 7 |
4 | 3 |
5 | 1 |
Measures of Variation
Range and Standard Deviation
Consider these three sets of quiz scores:
Section A: 5 5 5 5 5 5 5 5 5 5
Section B: 0 0 0 0 0 10 10 10 10 10
Section C: 4 4 4 5 5 5 5 6 6 6
All three of these sets of data have a mean of 5 and median of 5, yet the sets of scores are clearly quite different. In section A, everyone had the same score; in section B half the class got no points and the other half got a perfect score, assuming this was a 10-point quiz. Section C was not as consistent as section A, but not as widely varied as section B.
In addition to the mean and median, which are measures of the “typical” or “middle” value, we also need a measure of how “spread out” or varied each data set is.
There are several ways to measure this “spread” of the data. The first is the simplest and is called the range.
Range
The range is the difference between the maximum value and the minimum value of the data set.
example
Using the quiz scores from above,
For section A, the range is 0 since both maximum and minimum are 5 and 5 – 5 = 0
For section B, the range is 10 since 10 – 0 = 10
For section C, the range is 2 since 6 – 4 = 2
In the last example, the range seems to be revealing how spread out the data is. However, suppose we add a fourth section, Section D, with scores 0 5 5 5 5 5 5 5 5 10.
This section also has a mean and median of 5. The range is 10, yet this data set is quite different than Section B. To better illuminate the differences, we’ll have to turn to more sophisticated measures of variation.
The range of this example is explained in the following video.
Standard deviation
The standard deviation is a measure of variation based on measuring how far each data value deviates, or is different, from the mean. A few important characteristics:
- Standard deviation is always positive. Standard deviation will be zero if all the data values are equal, and will get larger as the data spreads out.
- Standard deviation has the same units as the original data.
- Standard deviation, like the mean, can be highly influenced by outliers.
Using the data from section D, we could compute for each data value the difference between the data value and the mean:
data value | deviation: data value – mean |
---|---|
0 | 0-5 = -5 |
5 | 5-5 = 0 |
5 | 5-5 = 0 |
5 | 5-5 = 0 |
5 | 5-5 = 0 |
5 | 5-5 = 0 |
5 | 5-5 = 0 |
5 | 5-5 = 0 |
5 | 5-5 = 0 |
10 | 10-5 = 5 |
We would like to get an idea of the “average” deviation from the mean, but if we find the average of the values in the second column the negative and positive values cancel each other out (this will always happen), so to prevent this we square every value in the second column:
data value | deviation: data value – mean | deviation squared |
---|---|---|
0 | 0-5 = -5 | (-5)2 = 25 |
5 | 5-5 = 0 | 02 = 0 |
5 | 5-5 = 0 | 02 = 0 |
5 | 5-5 = 0 | 02 = 0 |
5 | 5-5 = 0 | 02 = 0 |
5 | 5-5 = 0 | 02 = 0 |
5 | 5-5 = 0 | 02 = 0 |
5 | 5-5 = 0 | 02 = 0 |
5 | 5-5 = 0 | 02 = 0 |
10 | 10-5 = 5 | (5)2 = 25 |
We then add the squared deviations up to get 25 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 25 = 50. Ordinarily we would then divide by the number of scores, n, (in this case, 10) to find the mean of the deviations. But we only do this if the data set represents a population; if the data set represents a sample (as it almost always does), we instead divide by n – 1 (in this case, 10 – 1 = 9).[1]
So in our example, we would have 50/10 = 5 if section D represents a population and 50/9 = about 5.56 if section D represents a sample. These values (5 and 5.56) are called, respectively, the population variance and the sample variance for section D.
Variance can be a useful statistical concept, but note that the units of variance in this instance would be points-squared since we squared all of the deviations. What are points-squared? Good question. We would rather deal with the units we started with (points in this case), so to convert back we take the square root and get:
[latex]\begin{align}&\text{populationstandarddeviation}=\sqrt{\frac{50}{10}}=\sqrt{5}\approx2.2\\&\text{or}\\&\text{samplestandarddeviation}=\sqrt{\frac{50}{9}}\approx2.4\\\end{align}[/latex]
If we are unsure whether the data set is a sample or a population, we will usually assume it is a sample, and we will round answers to one more decimal place than the original data, as we have done above.
To compute standard deviation
- Find the deviation of each data from the mean. In other words, subtract the mean from the data value.
- Square each deviation.
- Add the squared deviations.
- Divide by n, the number of data values, if the data represents a whole population; divide by n – 1 if the data is from a sample.
- Compute the square root of the result.
example
Computing the standard deviation for Section B above, we first calculate that the mean is 5. Using a table can help keep track of your computations for the standard deviation:
data value | deviation: data value – mean | deviation squared |
---|---|---|
0 | 0-5 = -5 | (-5)2 = 25 |
0 | 0-5 = -5 | (-5)2 = 25 |
0 | 0-5 = -5 | (-5)2 = 25 |
0 | 0-5 = -5 | (-5)2 = 25 |
0 | 0-5 = -5 | (-5)2 = 25 |
10 | 10-5 = 5 | (5)2 = 25 |
10 | 10-5 = 5 | (5)2 = 25 |
10 | 10-5 = 5 | (5)2 = 25 |
10 | 10-5 = 5 | (5)2 = 25 |
10 | 10-5 = 5 | (5)2 = 25 |
Assuming this data represents a population, we will add the squared deviations, divide by 10, the number of data values, and compute the square root:
[latex]\sqrt{\frac{25+25+25+25+25+25+25+25+25+25}{10}}=\sqrt{\frac{250}{10}}=5[/latex]
Notice that the standard deviation of this data set is much larger than that of section D since the data in this set is more spread out.
For comparison, the standard deviations of all four sections are:
Section A: 5 5 5 5 5 5 5 5 5 5 | Standard deviation: 0 |
Section B: 0 0 0 0 0 10 10 10 10 10 | Standard deviation: 5 |
Section C: 4 4 4 5 5 5 5 6 6 6 | Standard deviation: 0.8 |
Section D: 0 5 5 5 5 5 5 5 5 10 | Standard deviation: 2.2 |
See the following video for more about calculating the standard deviation in this example.
Try It
The price of a jar of peanut butter at 5 stores was $3.29, $3.59, $3.79, $3.75, and $3.99. Find the standard deviation of the prices.
Where standard deviation is a measure of variation based on the mean, quartiles are based on the median.
Quartiles
Quartiles are values that divide the data in quarters.
The first quartile (Q1) is the value so that 25% of the data values are below it; the third quartile (Q3) is the value so that 75% of the data values are below it. You may have guessed that the second quartile is the same as the median, since the median is the value so that 50% of the data values are below it.
This divides the data into quarters; 25% of the data is between the minimum and Q1, 25% is between Q1 and the median, 25% is between the median and Q3, and 25% is between Q3 and the maximum value.
While quartiles are not a 1-number summary of variation like standard deviation, the quartiles are used with the median, minimum, and maximum values to form a 5 number summary of the data.
Five number summary
The five number summary takes this form:
Minimum, Q1, Median, Q3, Maximum
To find the first quartile, we need to find the data value so that 25% of the data is below it. If n is the number of data values, we compute a locator by finding 25% of n. If this locator is a decimal value, we round up, and find the data value in that position. If the locator is a whole number, we find the mean of the data value in that position and the next data value. This is identical to the process we used to find the median, except we use 25% of the data values rather than half the data values as the locator.
To find the first quartile, Q1
- Begin by ordering the data from smallest to largest
- Compute the locator: L = 0.25n
- If L is a decimal value:
- Round up to L+
- Use the data value in the L+th position
- If L is a whole number:
- Find the mean of the data values in the Lth and L+1th positions.
To find the third quartile, Q3
Use the same procedure as for Q1, but with locator: L = 0.75n
Examples should help make this clearer.
examples
Suppose we have measured 9 females, and their heights (in inches) sorted from smallest to largest are:
59 60 62 64 66 67 69 70 72
What are the first and third quartiles?
Suppose we had measured 8 females, and their heights (in inches) sorted from smallest to largest are:
59 60 62 64 66 67 69 70
What are the first and third quartiles? What is the 5 number summary?
The 5-number summary combines the first and third quartile with the minimum, median, and maximum values.
What are the 5-number summaries for each of the previous 2 examples?
More about each set of women’s heights is in the following videos.
Returning to our quiz score data: in each case, the first quartile locator is 0.25(10) = 2.5, so the first quartile will be the 3rd data value, and the third quartile will be the 8th data value. Creating the five-number summaries:
Section and data | 5-number summary |
Section A: 5 5 5 5 5 5 5 5 5 5 | 5, 5, 5, 5, 5 |
Section B: 0 0 0 0 0 10 10 10 10 10 | 0, 0, 5, 10, 10 |
Section C: 4 4 4 5 5 5 5 6 6 6 | 4, 4, 5, 6, 6 |
Section D: 0 5 5 5 5 5 5 5 5 10 | 0, 5, 5, 5, 10 |
Of course, with a relatively small data set, finding a five-number summary is a bit silly, since the summary contains almost as many values as the original data.
A video walkthrough of this example is available below.
Try It
The total cost of textbooks for the term was collected from 36 students. Find the 5 number summary of this data.
$140 $160 $160 $165 $180 $220 $235 $240 $250 $260 $280 $285
$285 $285 $290 $300 $300 $305 $310 $310 $315 $315 $320 $320
$330 $340 $345 $350 $355 $360 $360 $380 $395 $420 $460 $460
Example
Returning to the household income data from earlier in the section, create the five-number summary.
Income (thousands of dollars) | Frequency |
15 | 6 |
20 | 8 |
25 | 11 |
30 | 17 |
35 | 19 |
40 | 20 |
45 | 12 |
50 | 7 |
This example is demonstrated in this video.
Note that the 5 number summary divides the data into four intervals, each of which will contain about 25% of the data. In the previous example, that means about 25% of households have income between $40 thousand and $50 thousand.
For visualizing data, there is a graphical representation of a 5-number summary called a box plot, or box and whisker graph.
Box plot
A box plot is a graphical representation of a five-number summary.
To create a box plot, a number line is first drawn. A box is drawn from the first quartile to the third quartile, and a line is drawn through the box at the median. “Whiskers” are extended out to the minimum and maximum values.
examples
The box plot below is based on the 9 female height data with 5 number summary:
59, 62, 66, 69, 72.
The box plot below is based on the household income data with 5 number summary:
15, 27.5, 35, 40, 50
Box plot creation is described further here.
Try It
Create a box plot based on the textbook price data from the last Try It.
Box plots are particularly useful for comparing data from two populations.
examples
The box plot of service times for two fast-food restaurants is shown below.
While store 2 had a slightly shorter median service time (2.1 minutes vs. 2.3 minutes), store 2 is less consistent, with a wider spread of the data.
At store 1, 75% of customers were served within 2.9 minutes, while at store 2, 75% of customers were served within 5.7 minutes.
Which store should you go to in a hurry?
The box plot below is based on the birth weights of infants with severe idiopathic respiratory distress syndrome (SIRDS)[2]. The box plot is separated to show the birth weights of infants who survived and those that did not.
Comparing the two groups, the box plot reveals that the birth weights of the infants that died appear to be, overall, smaller than the weights of infants that survived. In fact, we can see that the median birth weight of infants that survived is the same as the third quartile of the infants that died.
Similarly, we can see that the first quartile of the survivors is larger than the median weight of those that died, meaning that over 75% of the survivors had a birth weight larger than the median birth weight of those that died.
Looking at the maximum value for those that died and the third quartile of the survivors, we can see that over 25% of the survivors had birth weights higher than the heaviest infant that died.
The box plot gives us a quick, albeit informal, way to determine that birth weight is quite likely linked to survival of infants with SIRDS.
The following video analyzes the examples above.
Candela Citations
- Learning Objectives and Introduction. Provided by: Lumen Learning. License: CC BY: Attribution
- Revision and Adaptation. Provided by: Lumen Learning. License: CC BY: Attribution
- Math in Society. Authored by: David Lippman. Located at: http://www.opentextbookstore.com/mathinsociety/. License: CC BY-SA: Attribution-ShareAlike
- Magnetic. Authored by: Philippe Put. Located at: https://flic.kr/p/dekJZd. License: CC BY: Attribution
- Finding the mean of a data set. Authored by: OCLPhase2's channel. Located at: https://youtu.be/3if9Le2sO0c. License: CC BY: Attribution
- Mean from a frequency table. Authored by: OCLPhase2's channel. Located at: https://youtu.be/1_4Hxcq8DpQ. License: CC BY: Attribution
- Median from a data list. Authored by: OCLPhase2's channel. Located at: https://youtu.be/WEdr_rSRObk. License: CC BY: Attribution
- Median from a frequency table. Authored by: OCLPhase2's channel. Located at: https://youtu.be/kqEu9EDkmfU. License: CC BY: Attribution
- Mode for categorical data. Authored by: OCLPhase2's channel. Located at: https://youtu.be/pFpkWrib3Jk. License: CC BY: Attribution
- Butte aux canons. Authored by: Alexandre Duret-Lutz. Located at: https://flic.kr/p/stgEf. License: CC BY-SA: Attribution-ShareAlike
- Finding range of a data set. Authored by: OCLPhase2's channel. Located at: https://youtu.be/b3ofWalrHgQ. License: CC BY: Attribution
- Computing standard deviation 1. Authored by: OCLPhase2's channel. Located at: https://youtu.be/wS8z90f04OU. License: CC BY: Attribution
- Five number summary 1. Authored by: OCLPhase2's channel. Located at: https://youtu.be/00iQvPOOUu4. License: CC BY: Attribution
- Five number summary 2. Authored by: OCLPhase2's channel. Located at: https://youtu.be/x73G2Nep05g. License: CC BY: Attribution
- Five number summary 3. Authored by: OCLPhase2's channel. Located at: https://youtu.be/uifLbZKPUDU. License: CC BY: Attribution
- Five number summary from a frequency table. Authored by: OCLPhase2's channel. Located at: https://youtu.be/ECOeeDrUxpo. License: CC BY: Attribution
- Creating a boxplot. Authored by: OCLPhase2's channel. Located at: https://youtu.be/s4SPGFlMBMU. License: CC BY: Attribution
- Comparing boxplots. Authored by: OCLPhase2's channel. Located at: https://youtu.be/eUkgf-2NVO8. License: CC BY: Attribution
- The reason we do this is highly technical, but we can see how it might be useful by considering the case of a small sample from a population that contains an outlier, which would increase the average deviation: the outlier very likely won't be included in the sample, so the mean deviation of the sample would underestimate the mean deviation of the population; thus we divide by a slightly smaller number to get a slightly bigger average deviation. ↵
- van Vliet, P.K. and Gupta, J.M. (1973) Sodium bicarbonate in idiopathic respiratory distress syndrome. Arch. Disease in Childhood, 48, 249–255. As quoted on http://openlearn.open.ac.uk/mod/oucontent/view.php?id=398296§ion=1.1.3 ↵