# Is it valid to calculate standard deviation for n=2?

My colleagues and I are having discussion whether it's valid to calculate standard deviation for $n=2$ or not? I think it's valid since I can calculate based on the equation, but higher N will give more power in the analysis. Can anyone comment? Thank you!

• Valid, sure; useful, not so much. – André Nicolas Dec 21 '15 at 16:15
• I can't think of a counter-argument. What are they ? – Yves Daoust Dec 21 '15 at 16:52
• @AndréNicolas: for $N=2$, the standard deviation and range coincide (to a constant). Both are a cheap measure of spread that can be quite useful. An example application is the measure of temporal noise in images when you cannot afford taking more than two of them. – Yves Daoust Dec 21 '15 at 16:58

## 2 Answers

Standard deviation is a measure of spread from the mean, so it is defined even when $N=1$ (although in that case it will always be 0). Certainly when $N=2$, it is a meaningful statistic.

And you are right -- if $N$ is larger, the statistic will be more powerful.

• I am not so sure about the $0$ spread. I'd rather say it's indeterminate. – Yves Daoust Dec 21 '15 at 17:00
• @YvesDaoust interesting -- why? If you the entire population of 1 element, its distance from itself is certainly 0... – gt6989b Dec 21 '15 at 19:06
• For $N>1$, $\hat\sigma$ is an estimator of $\sigma$. For $N=1$, nothing can be estimated (I wouldn't take $0$ as a good estimator of $\sigma$). – Yves Daoust Dec 21 '15 at 19:13
• @YvesDaoust the first one was my intuition too - no indeterminacy: $$\sigma^2 = \frac{1}{n} \sum_{k = 1}^n (x_k - \mu)^2 = \frac{(x_1 - \mu)^2}{1} = 0$$ since $x_1 = \mu$... – gt6989b Dec 21 '15 at 19:15
• I removed that in the meantime (even though the argument holds for the unbiaised variance). – Yves Daoust Dec 21 '15 at 19:17

It depends on how many "degrees of freedom" you have, or how much data you have left after estimating the other parameters you need before getting to the variance. If you have a single univariate sample and just want to estimate a variance, you can since this only requires an estimate of the mean. If on the other hand you have a simple linear regression and have fit an intercept and slope, then you have no degrees of freedom left and can't estimate the variance of the error term.