## The Problem

The standard deviation is a measure of how variable the data are. The variance is also a measure of how spread out the data are. The main advantage of the standard deviation over the variance is that the units of the standard deviation are the same as those of the original data. That means the standard deviation can be represented on the same graphic used to represent the data.

Because the standard deviation uses the mean in its calculations, it would only make sense to use the standard deviation if the mean should also have been used. Thus, data that are highly skewed should not use the standard deviation to represent variability. To illustrate calculating the standard deviation, assume that you collected the following 4 data values:

5, 89, 82, 12

Calculate the standard deviation of this sample, s.

## Your Answer

You got the correct answer of **44.6393**. Congratulations!

Unfortunately, your answer was not correct. Either try again or click on “Show Solution” below to see how to obtain the correct answer.

## Assistance

Hide Solution

$$
\begin{align}
s &= \sqrt{ \frac{1}{n-1} \sum_{i=1}^{n} (x_i-\bar{x})^2} \\
&= \sqrt{ \frac{1}{4-1} \sum_{i=1}^{4} (x_i-47)^2} \\
&= \sqrt{\frac{1}{3} \left( (5-47)^2 + (89-47)^2 + (82-47)^2 + (12-47)^2 \right)} \\
&= \sqrt{ \frac{1}{3} \left( (-42)^2 + (42)^2 + (35)^2 + (-35)^2 \right) } \\
&= \sqrt{ \frac{1}{3} \left( (1764) + (1764) + (1225) + (1225) \right) } \\
&= \sqrt{ \phantom{I} 1992.6667 \phantom{I^1} } \\
\end{align}
$$

Thus, the standard deviation of these 4 values is 44.6393.

Hide the R Code

Copy and paste the following code into your R script window, then run it from there.

sample = c(5, 89, 82, 12)

sd(sample)

In the R output, the sample standard deviation is the number output by the script.

Hide the Excel Code

Copy and paste the following code into your Excel spreadsheet window, making sure your cursor is in `A1`

when you paste.

sample

5

89

82

12

=STDEV.S(A2:A5)

Note that the function in Excel is `STDEV.S`

and *not* `STDEV.P`

, which returns the *population* standard deviation.