In statistics, the standard deviation is a measure of the amount of variation of the values of a variable about its (arithmetic) average. A low standard deviation indicates that the values of a set tend to be close to their average, while a high standard deviation indicates that the values are spread out over a wider range. Standard deviation may be abbreviated SD or std dev, and is most commonly represented in mathematical texts and equations by the lowercase Greek letter (sigma).

In the case of a normal distribution (as typified by the symmetrical bell-shaped curve), approximately 68.3% of all values fall within one standard deviation of the average, 95.4% within two standard deviations, and 99.7% within three.

The standard deviation of a random variable, sample, statistical population, data set or probability distribution is the square root of its variance (the variance being the average of the squared deviations from the mean). A useful property of the standard deviation is that, unlike the variance, it is expressed in the same unit as the data. Standard deviation can also be used to calculate standard error for a finite sample, and to determine statistical significance.

When only a sample of data from a population is available, the term standard deviation of the sample or sample standard deviation can refer to either the above-mentioned quantity as applied to those data, or to a modified quantity that is an unbiased estimate of the population standard deviation (the standard deviation of the entire population).

Relationship with standard error and statistical significance

The standard deviation of a population or sample and the standard error of a statistic (e.g., of the sample mean) are quite different, but related. The sample mean's standard error is the standard deviation of the set of means that would be found by drawing an infinite number of repeated samples from the population and computing a mean for each sample. The mean's standard error turns out to equal the population standard deviation divided by the square root of the sample size, and is estimated by using the sample standard deviation divided by the square root of the sample size. For example, a poll's standard error (what is reported as the margin of error of the poll) is the expected standard deviation of the estimated mean if the same poll were to be conducted multiple times. Thus, the standard error estimates the standard deviation of an estimate, which itself measures how much the estimate depends on the particular sample that was taken from the population.

In science, it is common to report both the standard deviation of the data (as a summary statistic) and the standard error of the estimate (as a measure of potential error in the findings). By convention, only effects more than two standard errors away from a null expectation are considered "statistically significant", a safeguard against spurious conclusion that is really due to random sampling error.

Basic examples

Population standard deviation of grades of eight students Suppose that the entire population of interest is eight students in a particular class. Their marks are the following eight values:

For a finite set of numbers, the population standard deviation is found by taking the square root of the average of the squared deviations of the values subtracted from their average value, that is:

These eight data points have the mean (average) of 5:

Next, calculate the deviations of each data point from the mean. Then square the result of each:

Next, the variance is the mean of these values:

Finally, the population standard deviation is the square root of the variance:

If the eight values with which we began are not the entire population of interest, then this is only one of many possible estimates of the standard deviation in the whole population. This specific one is biased, meaning that its expected value in repeated sampling deviates from the true value, but it is still consistent. Its mean squared error, on the other hand, may be lower than that of the unbiased estimator.

Standard deviation of average height for adult men If the population of interest is approximately normally distributed, the standard deviation provides information on the proportion of observations above or below certain values. For example, the average height for adult men in the United States is about , with a standard deviation of around . This means that most men (about 68%, assuming a normal distribution) have a height within 3 inches of the mean ()one standard deviationand almost all men (about 95%) have a height within of the mean ()two standard deviations. If the standard deviation were zero, then all men would share an identical height of 69 inches. Three standard deviations account for 99.73% of the sample population being studied, assuming the distribution is normal or bell-shaped .

Definition of population values Let be the expected value (the average) of a random variable with probability density function :

The standard deviation of is defined as

which can be shown to equal

In other words, the standard deviation is the square root of the variance of .

The standard deviation of a probability distribution is the same as that of a random variable having that distribution.

Not all random variables have a standard deviation. If the distribution has fat tails going out to infinity, the standard deviation might not exist, because the integral might not converge. The normal distribution has tails going out to infinity, but its mean and standard deviation do exist, because the tails diminish quickly enough. The Pareto distribution with parameter has a mean, but not a standard deviation (loosely speaking, the standard deviation is infinite). The Cauchy distribution has neither a mean nor a standard deviation.

Discrete random variable In the case where takes random values from a finite data set , with each value having the same probability, the standard deviation is

Note: The above expression has a built-in bias. See the discussion on Bessel's correction further down below.

or, by using summation notation,

If, instead of having equal probabilities, the values have different probabilities, let have probability , have probability have probability In this case, the standard deviation will be

Continuous random variable The standard deviation of a continuous real-valued random variable with probability density function is

and where the integrals are definite integrals taken for ranging over , which represents the set of possible values of the random variable .

In the case of a parametric family of distributions, the standard deviation can often be expressed in terms of the parameters for the underlying distribution. For example, in the case of the log-normal distribution with parameters and for the underlying normal distribution, the standard deviation of the log-normal variable is given by the expression

Estimation

One can find the standard deviation of an entire population in cases (such as standardized testing) where every member of a population is sampled. In cases where that cannot be done, the standard deviation is estimated by examining a random sample taken from the population and computing a statistic of the sample, which is used as an estimate of the population standard deviation. Such a statistic is called an estimator, and the estimator (or the value of the estimator, namely the estimate) is called a sample standard deviation, and is denoted by (possibly with modifiers).

Unlike in the case of estimating the population mean of a normal distribution, for which the sample mean is a simple estimator with many desirable properties (unbiased, efficient, maximum likelihood), there is no single estimator for the standard deviation with all these properties, and unbiased estimation of standard deviation is a very technically involved problem. Most often, the standard deviation is estimated using the corrected sample standard deviation (using ), defined below, and this is often referred to as the "sample standard deviation", without qualifiers. However, other estimators are better in other respects: the uncorrected estimator (using ) yields lower mean squared error, while using (for the normal distribution) almost eliminates bias.

Uncorrected sample standard deviation The formula for the population standard deviation (of a finite population) can be applied to the sample, using the size of the sample as the size of the population (though the actual population size from which the sample is drawn may be much larger). This estimator, denoted by , is known as the uncorrected sample standard deviation, or sometimes the standard deviation of the sample (considered as the entire population), and is defined as follows:

where are the observed values of the sample items and is the mean value of these observations, while the denominator stands for the size of the sample: this is the square root of the sample variance, which is the average of the squared deviations about the sample mean.

This is a consistent estimator (it converges in probability to the population value as the number of samples goes to infinity), and is the maximum-likelihood estimate when the population is normally distributed. However, this is a biased estimator, as the estimates are generally too low. The bias decreases as sample size grows, dropping off as , and thus is most significant for small or moderate sample sizes; for > 75, the bias is below 1%. Thus for very large sample sizes, the uncorrected sample standard deviation is generally acceptable. This estimator also has a uniformly smaller mean squared error than the corrected sample standard deviation.

Corrected sample standard deviation

If the biased sample variance (the second central moment of the sample, which is a downward-biased estimate of the population variance) is used to compute an estimate of the population's standard deviation, the result is

Here taking the square root introduces further downward bias, by Jensen's inequality, due to the square root's being a concave function. The bias in the variance is easily corrected, but the bias from the square root is more difficult to correct, and depends on the distribution in question.

An unbiased estimator for the variance is given by applying Bessel's correction, using instead of to yield the unbiased sample variance, denoted :

This estimator is unbiased if the variance exists and the sample values are drawn independently with replacement. corresponds to the number of degrees of freedom in the vector of deviations from the mean,

Taking square roots reintroduces bias (because the square root is a nonlinear function which does not commute with the expectation, i.e. often ), yielding the corrected sample standard deviation, denoted by :

As explained above, while is an unbiased estimator for the population variance, is still a biased estimator for the population standard deviation, though markedly less biased than the uncorrected sample standard deviation. This estimator is commonly used and generally known simply as the "sample standard deviation". The bias may still be large for small samples ( less than 10). As sample size increases, the amount of bias decreases. We obtain more information and the difference between and becomes smaller.

Unbiased sample standard deviation For unbiased estimation of standard deviation, there is no formula that works across all distributions, unlike for mean and variance. Instead, is used as a basis, and is scaled by a correction factor to produce an unbiased estimate. For the normal distribution, an unbiased estimator is given by , where the correction factor (which depends on ) is given in terms of the gamma function, and equals:

This arises because the sampling distribution of the sample standard deviation follows a (scaled) chi distribution, and the correction factor is the mean of the chi distribution.