## 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 9 data values:

58, 63, 58, 97, 57, 79, 77, 5, 97

Calculate the standard deviation of this sample, s.

## Your Answer

You got the correct answer of **27.7263**. 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}{9-1} \sum_{i=1}^{9} (x_i-66)^2} \\
&= \sqrt{\frac{1}{8} \left( (58-65.6667)^2 + (63-65.6667)^2 + (58-65.6667)^2 + (97-65.6667)^2 + (57-65.6667)^2 + (79-65.6667)^2 + (77-65.6667)^2 + (5-65.6667)^2 + (97-66)^2 \right)} \\
&= \sqrt{ \frac{1}{8} \left( (-7.6667)^2 + (-2.6667)^2 + (-7.6667)^2 + (31.3333)^2 + (-8.6667)^2 + (13.3333)^2 + (11.3333)^2 + (-60.6667)^2 + (31.3333)^2 \right) } \\
&= \sqrt{ \frac{1}{8} \left( (58.7778) + (7.1111) + (58.7778) + (981.7778) + (75.1111) + (177.7778) + (128.4444) + (3680.4444) + (981.7778) \right) } \\
&= \sqrt{ \phantom{I} 768.75 \phantom{I^1} } \\
\end{align}
$$

Thus, the standard deviation of these 9 values is 27.7263.

Hide the R Code

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

sample = c(58, 63, 58, 97, 57, 79, 77, 5, 97)

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

58

63

58

97

57

79

77

5

97

=STDEV.S(A2:A10)

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

and *not* `STDEV.P`

, which returns the *population* standard deviation.