## 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:

100, 21, 92, 93, 4, 43, 16, 65, 1

Calculate the standard deviation of this sample, s.

## Your Answer

You got the correct answer of **40.1186**. 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-48)^2} \\
&= \sqrt{\frac{1}{8} \left( (100-48.3333)^2 + (21-48.3333)^2 + (92-48.3333)^2 + (93-48.3333)^2 + (4-48.3333)^2 + (43-48.3333)^2 + (16-48.3333)^2 + (65-48.3333)^2 + (1-48)^2 \right)} \\
&= \sqrt{ \frac{1}{8} \left( (51.6667)^2 + (-27.3333)^2 + (43.6667)^2 + (44.6667)^2 + (-44.3333)^2 + (-5.3333)^2 + (-32.3333)^2 + (16.6667)^2 + (-47.3333)^2 \right) } \\
&= \sqrt{ \frac{1}{8} \left( (2669.4444) + (747.1111) + (1906.7778) + (1995.1111) + (1965.4444) + (28.4444) + (1045.4444) + (277.7778) + (2240.4444) \right) } \\
&= \sqrt{ \phantom{I} 1609.5 \phantom{I^1} } \\
\end{align}
$$

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

Hide the R Code

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

sample = c(100, 21, 92, 93, 4, 43, 16, 65, 1)

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

100

21

92

93

4

43

16

65

1

=STDEV.S(A2:A10)

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

and *not* `STDEV.P`

, which returns the *population* standard deviation.