Brighton Webs Ltd.
Statistics for Energy and the Environment
Home Index About

Standard Deviation and Variance

A set of numbers can be summarised by the mean and standard deviation, the mean provides the location and the standard deviation describes the spread of values around that value.

The standard deviation of a population is the square root of the average square of the difference between a given value and the mean, the formula being:

Standard Deviation - Formula

A small dataset shows how this formula work:

Values = 2, 4, 8        N=3, Mean=4.67, Standard Deviation=2.49

The calculation of the standard deviation is a four step process:

Step 1

Calculate the mean

Step 2

Calculated the square of the difference between a value and the mean

Step 3

Calculate the variance by summing the values obtained in step 2 and dividing by the number of values.

Step 4

Obtain the standard deviation by taking the square root of the variance.

These steps are illustrated by the table below::

2.00 2.00-4.67=-2.67 7.13
4.00 4.00-4.67=-0.67 0.45
8.00 8.00-4.67= 3.33 11.09
14.00   18.67

The column sums are used to calculate, first the mean and then the standard deviation:

The above calculation has been performed using two decimal places.

The larger the value of standard deviation, the the greater the spread of values around the mean.

Use as a Summary Statistic

The graph below is loosely based on two sets of annual rainfall data for a 30 year period, one is for a humid, sub-tropical area and the other for a semi-arid, sub-tropical area:

Not only is the mean rainfall for the semi-arid area are much lower, the standard deviation is also lower.

Estimate of Standard Deviation

The above example is based on calculating the standard deviation of a population.  If used to estimate the standard deviation of a population from a sample, the result is an underestimate.  This is because the standard deviation of  a sample of one, is zero.  A better estimate is obtained by replacing n with with n-1 in the above formula:

Standard deviation - Estimate of population StDev from Sample

Obviously, as n increases, the difference between 1/n and 1/(n-1) becomes negligable.

Spreadsheets

Spreadsheets such as MS Excel and Google Docs have a StDev function, e.g.

=StDev(C16:C24)

These functions assume the input range represents a sample, thus when the example data is used as an argument:

=StDev(2,4,8)

produces 3.06.

Related pages:

Coefficient of Variation

Dispersion

Page updated: 04-May-2012