# Standard Deviation

## Definition

###### Definition

The standard deviation of a population or a sample of a population is a measure of spread. The definition is slightly different depending on whether the data is a population or a sample.

For population data $x_i$, it is defined as:

$\sigma_x = \sqrt{\sigma^2_x} = \sqrt{\frac1n \sum (x_i - \bar{x})^2}$

where $\bar{x}$ is the mean of the population and $\sigma^2_x$ is its variance.

For sample data $x_i$, it is defined as:

$s_x = \sqrt{s^2_x} = \sqrt{ \frac1{n-1} \sum (x_i - \bar{x})^2}$

The formula is related to the formula for distance given by Pythagoras' theorem?. See variance for more details.

The usual method to calculate the standard deviation is to calculate the variance and then take the square root. To calculate the standard deviation for grouped data?, see the formulae for variance.

In a spreadsheet, the formula to calculate the variance of a range is:

=stdevp(<range>)
=stdev(<range>)

The p suffix is for the population version.