# Standard deviation

{{#invoke:Hatnote|hatnote}}

Cumulative probability of a normal distribution with expected value 0 and standard deviation 1.

In statistics and probability theory, the standard deviation (SD) (represented by the Greek letter sigma, σ) measures the amount of variation or dispersion from the average.[1] A low standard deviation indicates that the data points tend to be very close to the mean (also called expected value); a high standard deviation indicates that the data points are spread out over a large range of values.

The standard deviation of a random variable, statistical population, data set, or probability distribution is the square root of its variance. It is algebraically simpler though in practice less robust than the average absolute deviation.[2][3] A useful property of the standard deviation is that, unlike the variance, it is expressed in the same units as the data. Note, however, that for measurements with percentage as the unit, the standard deviation will have percentage points as the unit.

In addition to expressing the variability of a population, the standard deviation is commonly used to measure confidence in statistical conclusions. For example, the margin of error in polling data is determined by calculating the expected standard deviation in the results if the same poll were to be conducted multiple times. The reported margin of error is typically about twice the standard deviation—the half-width of a 95 percent confidence interval. In science, researchers commonly report the standard deviation of experimental data, and only effects that fall much farther than two standard deviations away from what would have been expected are considered statistically significant—normal random error or variation in the measurements is in this way distinguished from causal variation. The standard deviation is also important in finance, where the standard deviation on the rate of return on an investment is a measure of the volatility of the investment.

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 a better estimate of the population standard deviation (the standard deviation of the entire population).

## Basic examples

For a finite set of numbers, the standard deviation is found by taking the square root of the average of the squared differences of the values from their average value. For example, consider a population consisting of the following eight values:

${\displaystyle 2,\ 4,\ 4,\ 4,\ 5,\ 5,\ 7,\ 9.}$

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

${\displaystyle {\frac {2+4+4+4+5+5+7+9}{8}}=5.}$

First, calculate the difference of each data point from the mean, and square the result of each:

${\displaystyle {\begin{array}{lll}(2-5)^{2}=(-3)^{2}=9&&(5-5)^{2}=0^{2}=0\\(4-5)^{2}=(-1)^{2}=1&&(5-5)^{2}=0^{2}=0\\(4-5)^{2}=(-1)^{2}=1&&(7-5)^{2}=2^{2}=4\\(4-5)^{2}=(-1)^{2}=1&&(9-5)^{2}=4^{2}=16.\\\end{array}}}$

Next, calculate the mean of these values, and take the square root:

${\displaystyle {\sqrt {\frac {9+1+1+1+0+0+4+16}{8}}}=2.}$

This quantity is the population standard deviation, and is equal to the square root of the variance. This formula is valid only if the eight values with which we began form the complete population. If the values instead were a random sample drawn from some larger parent population, then we would have divided by 7 (which is n−1) instead of 8 (which is n) in the denominator of the last formula, and then the quantity thus obtained would be called the sample standard deviation. Dividing by n−1 gives a better estimate of the population standard deviation than dividing by n{{ safesubst:#invoke:Unsubst||date=__DATE__ |B= {{#invoke:Category handler|main}}{{#invoke:Category handler|main}}[citation needed] }}. As a slightly more complicated real-life example, the average height for adult men in the United States is about 70 inches, with a standard deviation of around 3 inches. This means that most men (about 68 percent, assuming a normal distribution) have a height within 3 inches of the mean (67–73 inches) – one standard deviation – and almost all men (about 95%) have a height within 6 inches of the mean (64–76 inches) – two standard deviations. If the standard deviation were zero, then all men would be exactly 70 inches tall. If the standard deviation were 20 inches, then men would have much more variable heights, with a typical range of about 50–90 inches. Three standard deviations account for 99.7 percent of the sample population being studied, assuming the distribution is normal (bell-shaped). ## Definition of population values Let X be a random variable with mean value μ: ${\displaystyle \operatorname {E} [X]=\mu .\,\!}$ Here the operator E denotes the average or expected value of X. Then the standard deviation of X is the quantity {\displaystyle {\begin{aligned}\sigma &={\sqrt {\operatorname {E} [(X-\mu )^{2}]}}\\&={\sqrt {\operatorname {E} [X^{2}]+\operatorname {E} [(-2\mu X)]+\operatorname {E} [\mu ^{2}]}}={\sqrt {\operatorname {E} [X^{2}]-2\mu \operatorname {E} [X]+\mu ^{2}}}\\&={\sqrt {\operatorname {E} [X^{2}]-2\mu ^{2}+\mu ^{2}}}={\sqrt {\operatorname {E} [X^{2}]-\mu ^{2}}}\\&={\sqrt {\operatorname {E} [X^{2}]-(\operatorname {E} [X])^{2}}}\end{aligned}}} (derived using the properties of expected value). In other words the standard deviation σ (sigma) is the square root of the variance of X; i.e., it is the square root of the average value of (X − μ)2. The standard deviation of a (univariate) probability distribution is the same as that of a random variable having that distribution. Not all random variables have a standard deviation, since these expected values need not exist. For example, the standard deviation of a random variable that follows a Cauchy distribution is undefined because its expected value μ is undefined. ### Discrete random variable In the case where X takes random values from a finite data set x1, x2, ..., xN, with each value having the same probability, the standard deviation is ${\displaystyle \sigma ={\sqrt {{\frac {1}{N}}\left[(x_{1}-\mu )^{2}+(x_{2}-\mu )^{2}+\cdots +(x_{N}-\mu )^{2}\right]}},{\rm {\ \ where\ \ }}\mu ={\frac {1}{N}}(x_{1}+\cdots +x_{N}),}$ or, using summation notation, ${\displaystyle \sigma ={\sqrt {{\frac {1}{N}}\sum _{i=1}^{N}(x_{i}-\mu )^{2}}},{\rm {\ \ where\ \ }}\mu ={\frac {1}{N}}\sum _{i=1}^{N}x_{i}.}$ If, instead of having equal probabilities, the values have different probabilities, let x1 have probability p1, x2 have probability p2, ..., xN have probability pN. In this case, the standard deviation will be ${\displaystyle \sigma ={\sqrt {\sum _{i=1}^{N}p_{i}(x_{i}-\mu )^{2}}},{\rm {\ \ where\ \ }}\mu =\sum _{i=1}^{N}p_{i}x_{i}.}$ ### Continuous random variable The standard deviation of a continuous real-valued random variable X with probability density function p(x) is ${\displaystyle \sigma ={\sqrt {\int _{\mathbf {X} }(x-\mu )^{2}\,p(x)\,dx}},{\rm {\ \ where\ \ }}\mu =\int _{\mathbf {X} }x\,p(x)\,dx,}$ and where the integrals are definite integrals taken for x ranging over the set of possible values of the random variable X. In the case of a parametric family of distributions, the standard deviation can be expressed in terms of the parameters. For example, in the case of the log-normal distribution with parameters μ and σ2, the standard deviation is [(exp(σ2) − 1)exp(2μ + σ2)]1/2. ## Estimation {{safesubst:#invoke:anchor|main}}{{safesubst:#invoke:anchor|main}} {{#invoke:see also|seealso}} {{#invoke:main|main}} Template:Move section portions 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 s (possibly with modifiers). However, unlike in the case of estimating the population mean, 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 N − 1), 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 N) yields lower mean squared error, while using N − 1.5 (for the normal distribution) almost completely eliminates bias. ### Uncorrected sample standard deviation Firstly, 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 sN, 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:{{ safesubst:#invoke:Unsubst||date=__DATE__ |B= {{#invoke:Category handler|main}}{{#invoke:Category handler|main}}[citation needed] }}

${\displaystyle s_{N}={\sqrt {{\frac {1}{N}}\sum _{i=1}^{N}(x_{i}-{\overline {x}})^{2}}},}$

where ${\displaystyle \scriptstyle \{x_{1},\,x_{2},\,\ldots ,\,x_{N}\}}$ are the observed values of the sample items and ${\displaystyle \scriptstyle {\overline {x}}}$ is the mean value of these observations, while the denominator N 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.

### Population-based statistics

The populations of sets, which may overlap, can be calculated simply as follows:

{\displaystyle {\begin{aligned}&&N_{X\cup Y}&=N_{X}+N_{Y}-N_{X\cap Y}\\X\cap Y=\varnothing &\Rightarrow &N_{X\cap Y}&=0\\&\Rightarrow &N_{X\cup Y}&=N_{X}+N_{Y}\end{aligned}}}

Standard deviations of non-overlapping (XY = ∅) sub-populations can be aggregated as follows if the size (actual or relative to one another) and means of each are known:

{\displaystyle {\begin{aligned}\mu _{X\cup Y}&={\frac {N_{X}\mu _{X}+N_{Y}\mu _{Y}}{N_{X}+N_{Y}}}\\\sigma _{X\cup Y}&={\sqrt {{\frac {N_{X}\sigma _{X}^{2}+N_{Y}\sigma _{Y}^{2}}{N_{X}+N_{Y}}}+{\frac {N_{X}N_{Y}}{(N_{X}+N_{Y})^{2}}}(\mu _{X}-\mu _{Y})^{2}}}\end{aligned}}}

For example, suppose it is known that the average American man has a mean height of 70 inches with a standard deviation of three inches and that the average American woman has a mean height of 65 inches with a standard deviation of two inches. Also assume that the number of men, N, is equal to the number of women. Then the mean and standard deviation of heights of American adults could be calculated as:

{\displaystyle {\begin{aligned}\mu &={\frac {N\cdot 70+N\cdot 65}{N+N}}={\frac {70+65}{2}}=67.5\\\sigma &={\sqrt {{\frac {3^{2}+2^{2}}{2}}+{\frac {(70-65)^{2}}{2^{2}}}}}={\sqrt {12.75}}\approx 3.57\end{aligned}}}

For the more general case of M non-overlapping populations, X1 through XM, and the aggregate population ${\displaystyle \scriptstyle X\,=\,\bigcup _{i}X_{i}}$:

{\displaystyle {\begin{aligned}\mu _{X}&={\frac {\sum _{i}N_{X_{i}}\mu _{X_{i}}}{\sum _{i}N_{X_{i}}}}\\\sigma _{X}&={\sqrt {{\frac {\sum _{i}N_{X_{i}}(\sigma _{X_{i}}^{2}+\mu _{X_{i}}^{2})}{\sum _{i}N_{X_{i}}}}-\mu _{X}^{2}}}={\sqrt {{\frac {\sum _{i}N_{X_{i}}\sigma _{X_{i}}^{2}}{\sum _{i}N_{X_{i}}}}+{\frac {\sum _{i

where

${\displaystyle X_{i}\cap X_{j}=\varnothing ,\quad \forall \ i

If the size (actual or relative to one another), mean, and standard deviation of two overlapping populations are known for the populations as well as their intersection, then the standard deviation of the overall population can still be calculated as follows:

{\displaystyle {\begin{aligned}\mu _{X\cup Y}&={\frac {1}{N_{X\cup Y}}}\left(N_{X}\mu _{X}+N_{Y}\mu _{Y}-N_{X\cap Y}\mu _{X\cap Y}\right)\\\sigma _{X\cup Y}&={\sqrt {{\frac {1}{N_{X\cup Y}}}\left(N_{X}[\sigma _{X}^{2}+\mu _{X}^{2}]+N_{Y}[\sigma _{Y}^{2}+\mu _{Y}^{2}]-N_{X\cap Y}[\sigma _{X\cap Y}^{2}+\mu _{X\cap Y}^{2}]\right)-\mu _{X\cup Y}^{2}}}\end{aligned}}}

If two or more sets of data are being added together datapoint by datapoint, the standard deviation of the result can be calculated if the standard deviation of each data set and the covariance between each pair of data sets is known:

${\displaystyle \sigma _{X}={\sqrt {\sum _{i}{\sigma _{X_{i}}^{2}}+\sum _{i,j}\operatorname {cov} (X_{i},X_{j})}}}$

For the special case where no correlation exists between any pair of data sets, then the relation reduces to the root-mean-square:

{\displaystyle {\begin{aligned}&\operatorname {cov} (X_{i},X_{j})=0,\quad \forall i

### Sample-based statistics

Standard deviations of non-overlapping (XY = ∅) sub-samples can be aggregated as follows if the actual size and means of each are known:

{\displaystyle {\begin{aligned}\mu _{X\cup Y}&={\frac {1}{N_{X\cup Y}}}\left(N_{X}\mu _{X}+N_{Y}\mu _{Y}\right)\\\sigma _{X\cup Y}&={\sqrt {{\frac {1}{N_{X\cup Y}-1}}\left([N_{X}-1]\sigma _{X}^{2}+N_{X}\mu _{X}^{2}+[N_{Y}-1]\sigma _{Y}^{2}+N_{Y}\mu _{Y}^{2}-[N_{X}+N_{Y}]\mu _{X\cup Y}^{2}\right)}}\end{aligned}}}

For the more general case of M non-overlapping data sets, X1 through XM, and the aggregate data set ${\displaystyle \scriptstyle X\,=\,\bigcup _{i}X_{i}}$:

{\displaystyle {\begin{aligned}\mu _{X}&={\frac {1}{\sum _{i}{N_{X_{i}}}}}\left(\sum _{i}{N_{X_{i}}\mu _{X_{i}}}\right)\\\sigma _{X}&={\sqrt {{\frac {1}{\sum _{i}{N_{X_{i}}-1}}}\left(\sum _{i}{\left[(N_{X_{i}}-1)\sigma _{X_{i}}^{2}+N_{X_{i}}\mu _{X_{i}}^{2}\right]}-\left[\sum _{i}{N_{X_{i}}}\right]\mu _{X}^{2}\right)}}\end{aligned}}}

where:

${\displaystyle X_{i}\cap X_{j}=\varnothing ,\quad \forall i

If the size, mean, and standard deviation of two overlapping samples are known for the samples as well as their intersection, then the standard deviation of the aggregated sample can still be calculated. In general:

{\displaystyle {\begin{aligned}\mu _{X\cup Y}&={\frac {1}{N_{X\cup Y}}}\left(N_{X}\mu _{X}+N_{Y}\mu _{Y}-N_{X\cap Y}\mu _{X\cap Y}\right)\\\sigma _{X\cup Y}&={\sqrt {\frac {[N_{X}-1]\sigma _{X}^{2}+N_{X}\mu _{X}^{2}+[N_{Y}-1]\sigma _{Y}^{2}+N_{Y}\mu _{Y}^{2}-[N_{X\cap Y}-1]\sigma _{X\cap Y}^{2}-N_{X\cap Y}\mu _{X\cap Y}^{2}-[N_{X}+N_{Y}-N_{X\cap Y}]\mu _{X\cup Y}^{2}}{N_{X\cup Y}-1}}}\end{aligned}}}

## History

The term standard deviation was first used[10] in writing by Karl Pearson[11] in 1894, following his use of it in lectures. This was as a replacement for earlier alternative names for the same idea: for example, Gauss used mean error.[12] It may be worth noting in passing that the mean error is mathematically distinct from the standard deviation.

{{#invoke:Portal|portal}}

## References

1. Template:Cite web
2. {{#invoke:Citation/CS1|citation |CitationClass=journal }}
3. {{#invoke:citation/CS1|citation |CitationClass=book }}
4. Template:Cite web
5. Template:Cite web
6. Template:Cite web
7. Ghahramani, Saeed (2000). Fundamentals of Probability (2nd Edition). Prentice Hall: New Jersey. p. 438.
8. Template:Cite web
9. {{#invoke:Citation/CS1|citation |CitationClass=journal }}
10. {{#invoke:citation/CS1|citation |CitationClass=book }}
11. {{#invoke:Citation/CS1|citation |CitationClass=journal }}
12. Template:Cite web