maths.freeStatistics & Probability › 8. Statistics › Range and Standard Deviation

Range and Standard Deviation

Calculate the range of a dataset

Learning Objectives

After completing this section, you should be able to:

  1. Calculate the range of a dataset
  2. Calculate the standard deviation of a dataset

The Range

Our first measure of dispersion is the range, or the difference between the maximum and minimum values in the set. It’s the measure we used in the standardized test example above.

Let’s look at a couple of examples.

Finding the Range

Try it.

You survey some of your friends to find out how many hours they work each week. Their responses are: 5, 20, 8, 10, 35, 12. What is the range?

Solution

The maximum value in the set is 35 and the minimum is 5, so the range is \(35-5=30\).

For large datasets, finding the maximum and minimum values can be daunting. There are two ways to do it in a spreadsheet. First, you can ask the spreadsheet program to sort the data from smallest to largest, then find the first and last numbers on the sorted list. The second method uses built-in functions to find the minimum and maximum.

In either method, once you’ve found the maximum and minimum, all you have to do is subtract to find the range.

Finding the Range with Google Sheets

Try it.

The data in “AvgSAT” contains the average SAT score for students attending every institution of higher learning in the US for which data is available. What is the range of these average SAT scores?

Solution

Step 1: To find the maximum, click on an empty cell in the spreadsheet, type “=MAX(”, and then click on the letter that marks the top of the column containing the AvgSAT data. That inserts a reference to the column into our function. Then we close the parentheses and hit the enter key. The formula is replaced with the maximum value in our data: 1566.
Step 2: Using the same process (but with “MIN” instead of “MAX”), we find the minimum value is 785.
Step 3: So, the range is \(1566-785=781\).

The range is very easy to compute, but it depends only on two of the data values in the entire set. If there happens to be just one unusually high or low data value, then the range might give a distorted measure of dispersion. Our next measure takes every single data value into account, making it more reliable.

The Standard Deviation

The standard deviation is a measure of dispersion that can be interpreted as approximately the average distance of every data value from the mean. (This distance from the mean is the “deviation” in “standard deviation.”)

To compute the standard deviation using the formula, we follow the steps below:

  1. Compute the mean of all the data values.
  2. Subtract the mean from each data value.
  3. Square those differences.
  4. Add up the results in step 3.
  5. Divide the result in step 4 by \(n-1\)
  6. Take the square root of the result in step 5.

Let’s see that process in action.

Computing the Standard Deviation

Try it.

You surveyed some of your friends to find out how many hours they work each week. Their responses were: 5, 20, 8, 10, 35, 12. What is the standard deviation?

Solution

Let’s follow the six steps mentioned previously to compute the standard deviation.

Step 1: Find the mean: \(\overset{\bar}{x}=\frac{5+20+8+10+35+12}{6}=15\).

Step 2: Subtract the mean from each data value. To help keep track, let’s do this in a table. In the first row, we’ll list each of our data values (and we’ll label the row \(x\)); in the second, we’ll subtract \(\overset{\bar}{x}=15\) from each data value.

\(x\)5208103512
\(x-\overset{\bar}{x}\)−105–7–520–3

Step 3: Square the differences. Let’s add a row to our table for those values:

\(x\)5208103512
\(x-\overset{\bar}{x}\)−105–7–520–3
\({(x-\overset{\bar}{x})}^{2}\)1002549254009

Step 4: Add up those squares: \(100\ +\ 25\ +\ 49\ +\ 25\ +\ 400\ +\ 9\ =\ 608\).

Step 5: Divide the sum by \(n-1\). Since we have 6 data values, that gives us \(\frac{608}{6-1}=121.6\).

Step 6: Take the square root of the result: \(\sqrt{121.6}\approx 11.027\).

Thus, the standard deviation is \(s\approx 11.027\).

The computation for the standard deviation is complicated, even for just a small dataset. We’d never want to compute it without technology for a large dataset! Luckily, technology makes this calculation easy.

Condensed — the full section is in OpenStax Contemporary Mathematics.

Key Concepts

  • The range of a dataset is the difference between its largest and smallest values. The standard deviation is approximately the mean difference (in absolute value) that individual units fall from the mean of the dataset.

Formulas

\(s=\sqrt{\frac{\sum {(x-\overset{\bar}{x})}^{2}}{n-1}}\)

Here, s is the standard deviation, \(x\) represents each data value, \(\overset{\bar}{x}\) is the mean of the data values, \(n\) is the number of data values, and the capital sigma (\(\Sigma\)) indicates that we take a sum.

Practice (4)

Try each one on paper first. Reveal the answer to check; verified ones can be opened in the solver for every step.

  1. You survey some of your friends to find out how many hours they work each week. Their responses are: 5, 20, 8, 10, 35, 12. What is the range?

    Жавобни кўрсатиш

    The maximum value in the set is 35 and the minimum is 5, so the range is \(35-5=30\).

  2. The data in “AvgSAT” contains the average SAT score for students attending every institution of higher learning in the US for which data is available. What is the range of these average SAT scores?

    Жавобни кўрсатиш

    Step 1: To find the maximum, click on an empty cell in the spreadsheet, type “=MAX(”, and then click on the letter that marks the top of the column containing the AvgSAT data. That inserts a reference to the column into our function. Then we close the parentheses and hit the enter key. The formula is replaced with the maximum value in our data: 1566.
    Step 2: Using the same process (but with “MIN” instead of “MAX”), we find the minimum value is 785.
    Step 3: So, the range is \(1566-785=781\).

  3. You surveyed some of your friends to find out how many hours they work each week. Their responses were: 5, 20, 8, 10, 35, 12. What is the standard deviation?

    Жавобни кўрсатиш

    Let’s follow the six steps mentioned previously to compute the standard deviation.

    Step 1: Find the mean: \(\overset{\bar}{x}=\frac{5+20+8+10+35+12}{6}=15\).

    Step 2: Subtract the mean from each data value. To help keep track, let’s do this in a table. In the first row, we’ll list each of our data values (and we’ll label the row \(x\)); in the second, we’ll subtract \(\overset{\bar}{x}=15\) from each data value.

    \(x\)5208103512
    \(x-\overset{\bar}{x}\)−105–7–520–3

    Step 3: Square the differences. Let’s add a row to our table for those values:

    \(x\)5208103512
    \(x-\overset{\bar}{x}\)−105–7–520–3
    \({(x-\overset{\bar}{x})}^{2}\)1002549254009

    Step 4: Add up those squares: \(100\ +\ 25\ +\ 49\ +\ 25\ +\ 400\ +\ 9\ =\ 608\).

    Step 5: Divide the sum by \(n-1\). Since we have 6 data values, that gives us \(\frac{608}{6-1}=121.6\).

    Step 6: Take the square root of the result: \(\sqrt{121.6}\approx 11.027\).

    Thus, the standard deviation is \(s\approx 11.027\).

  4. The data in “AvgSAT” contains the average SAT score for students attending every institution of higher learning in the US for which data is available. What is the standard deviation of these average SAT scores?

    Жавобни кўрсатиш

    To find the standard deviation, we click in an empty cell in our spreadsheet and then type “=STDEV(”. Next, click on the letter at the top of the column containing our data; this will put a reference to that column into our formula. Then close the parentheses with and hit the enter key. The formula is replaced with the result: 125.517.

Symbols used here

\sum_{k=1}^{n} a_k
summation
Add a_k for k = 1 up to n.
\sqrt{x},\ \sqrt[n]{x}
square root, n-th root
The non-negative number whose square (n-th power) is x.
\approx
approximately equal
Equal to the precision shown, not exactly.
\pm
plus or minus
Both signs at once: x = 3 ± 2 means 5 and 1.
n!
factorial
n × (n−1) × … × 1; the number of orderings of n things. 0! = 1.
\binom{n}{k}
binomial coefficient, "n choose k"
Number of k-element subsets of n things: n!/(k!(n−k)!).
A \cup B,\ A \cap B,\ A \setminus B
union, intersection, difference
In either; in both; in A but not B.
\bar{x},\ \mu
sample mean, population mean
Average of the data; average of the whole population.
\sigma,\ s,\ \sigma^2
standard deviation, sample s.d., variance
Typical distance from the mean; its square.
P(A),\ P(A \mid B)
probability, conditional probability
Chance of A; chance of A given that B happened.
E[X],\ \operatorname{Var}(X)
expected value, variance
Probability-weighted average of X; its spread.
N(\mu, \sigma^2),\ z
normal distribution, z-score
The bell curve with mean μ and variance σ²; (x − μ)/σ.

How to: Range and Standard Deviation

  1. Calculate the range of a dataset
  2. Calculate the standard deviation of a dataset
  3. Compute the mean of all the data values.
  4. Subtract the mean from each data value.
  5. Square those differences.
  6. Add up the results in step 3.
  7. Divide the result in step 4 by
  8. Take the square root of the result in step 5.

Questions people ask

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.

Ўзингизни синаб кўринг

Parts of this page are adapted from OpenStax Contemporary Mathematics (CC BY-NC-SA 4.0). Condensed and re-explained here; errors are ours.

Кўпроқ Statistics & Probability