### Definition/Introduction

The standard deviation (SD) measures the extent of scattering in a set of values, typically compared to the mean value of the set.[1][2][3] The calculation of the SD depends on whether the dataset is a sample or the entire population. Ideally, studies would obtain data from the entire target population, which defines the population parameter. However, this is rarely possible in medical research, and hence a sample of the population is often used.[4]

The sample SD is determined through the following steps:

- Calculate the deviation of each observation from the mean
- Square each of these results
- Add these results together
- Divide this sum by the 'total number of observations minus 1' - the result at this stage is called the sample variance.
- Square root this result - This number will be the sample SD.[1]

For example, to work out the sample SD of the following data set: (4, 5, 5, 5, 7, 8, 8, 8, 9, 10)

The first step would be to calculate the mean of the data set. This is done by adding the value of each observation together and then dividing by the number of observations. The sum of the values would be 69, which then is divided by 10, so the mean would be 6.9.

Then we would follow the same steps as above to work out the standard deviation:

- To calculate the deviation, subtract the mean from every observation which would result in the following values: (-2.9, -1.9, -1.9, -1.9, 0.1, 1.1, 1.1, 1.1, 2.1, 3.1)
- Then each value is squared to remove any negative values, resulting in the following values: (8.41, 3.61, 3.61, 3.61, 0.01, 1.21, 1.21, 1.21, 4.41, 9.61)
- The sum of these values is then calculated, which is 36.9
- The sample variance is then calculated. This is done by dividing the current value by the 'total number of observations minus 1', which in this case is 9: 36.9/9 = 4.1.
- Finally, the result is square rooted to find the sample standard deviation, which is 2.02 (to two decimal places).

The population SD is calculated similarly, with the only difference being in 'step 4' divided by the 'total number of observations' instead of ‘total number of observations minus 1’.

For example, if we take the same data set used above but instead calculate the SD assuming the data set was the total population.

- To calculate the deviation, subtract the mean from every observation which would result in the following values: (-2.9, -1.9, -1.9, -1.9, 0.1, 1.1, 1.1, 1.1, 2.1, 3.1)
- Then each value is squared to remove any negative values, resulting in the following values: (8.41, 3.61, 3.61, 3.61, 0.01, 1.21, 1.21, 1.21, 4.41, 9.61)
- The sum of these values is then calculated, which is 36.9
- The population variance is then calculated. This is done by dividing the current value by the 'total number of observations,' which in this case is 10. 36.9/10 = 3.69
- Finally, the result is square rooted to find the population standard deviation, which is 1.92 (to two decimal places)

As can be seen, by the formulas above, a large SD results from data with a large deviation from the mean, while a small SD shows the values are all quite close to the mean.[2][5]