# Intuitive explanation for dividing by $n-1$ when calculating standard deviation?

I was asked today in class why you divide the sum of square error by $n-1$ instead of with $n$, when calculating the standard deviation.

I said I am not going to answer it in class (since I didn't wanna go into unbiased estimators), but later I wondered - is there an intuitive explanation for this?!

• I'd like to quote this zinger from the book Numerical Recipes: "...if the difference between $n$ and $n-1$ ever matters to you, then you are probably up to no good anyway - e.g., trying to substantiate a questionable hypothesis with marginal data." Oct 25, 2010 at 14:09
• a really elegant, intuitive explanation is presented here (below the proof) en.wikipedia.org/wiki/… The basic idea is that your observations are, naturally, going to be closer to the sample mean than the population mean. May 26, 2014 at 16:23
• @Tal, This is why schools suck. You ask them "why this?", and they reply "just memorize it". Jun 3, 2015 at 11:51
• If you are looking for an intuitive explanation, you should see the reason for yourself by actually taking samples! Watch this, it precisely answers you question. youtube.com/watch?v=xslIhnquFoE Sep 24, 2015 at 23:36
• tl;dr: (from top answer:) "...the standard deviation which is calculated using deviations from the sample mean underestimates the desired standard deviation of the population..." See also: en.wikipedia.org/wiki/… So, unless you feel like calculating something somewhat complex, just use n-1 if it's from a sample. Aug 26, 2017 at 22:58

The standard deviation calculated with a divisor of $$n-1$$ is a standard deviation calculated from the sample as an estimate of the standard deviation of the population from which the sample was drawn. Because the observed values fall, on average, closer to the sample mean than to the population mean, the standard deviation which is calculated using deviations from the sample mean underestimates the desired standard deviation of the population. Using $$n-1$$ instead of $$n$$ as the divisor corrects for that by making the result a little bit bigger.

Note that the correction has a larger proportional effect when $$n$$ is small than when it is large, which is what we want because when n is larger the sample mean is likely to be a good estimator of the population mean.

When the sample is the whole population we use the standard deviation with $$n$$ as the divisor because the sample mean is population mean.

(I note parenthetically that nothing that starts with "second moment recentered around a known, definite mean" is going to fulfil the questioner's request for an intuitive explanation.)

• Let's not confuse "intuitive" with "nontechnical".
– whuber
Oct 24, 2010 at 15:38
• @Michael, This doesn't explain Why do we use n−1 instead of n−2 (or even n−3)? Jun 3, 2015 at 11:52
• @Pacerier Have a look at Whuber's answer below for detail on that point. In essence, the correction is n-1 rather than n-2 etc because the n-1 correction gives results that are very close to what we need. More exact corrections are shown here: en.wikipedia.org/wiki/Unbiased_estimation_of_standard_deviation Jun 3, 2015 at 21:37
• Hi @Michael, so why deviation calculated from sample mean tends to be smaller than population mean? Nov 15, 2016 at 3:57
• "Because the observed values fall, on average, closer to the sample mean than to the population mean, the standard deviation which is calculated using deviations from the sample mean underestimates the desired standard deviation of the population." Why the sample mean always underestimates? What if it overestimates? Nov 20, 2016 at 8:03

By definition, variance is calculated by taking the sum of squared differences from the mean and dividing by the size. We have the general formula

$\sigma^2= \frac{\sum_{i}^{N}(X_i-\mu)^2}{N}$ where $\mu$ is the mean and $N$ is the size of the population.

According to this definition, variance of the a sample (e.g. sample $t$) must also be calculated in this way.

$\sigma^2_t= \frac{\sum_{i}^{n}(X_i-\overline{X})^2}{n}$ where $\overline{X}$ is the mean and $n$ is the size of this small sample.

However, by sample variance $S^2$, we mean an estimator of the population variance $\sigma^2$. How can we estimate $\sigma^2$ only by using the values from the sample?

According to the formulas above, the random variable $X$ deviates from sample mean $\overline{X}$ with variance $\sigma^2_t$. The sample mean $\overline{X}$ also deviates from $\mu$ with variance $\frac{\sigma^2}{n}$ because sample mean gets different values from sample to sample and it is a random variable with mean $\mu$ and variance $\frac{\sigma^2}{n}$. (One can prove easily.)

Therefore, roughly, $X$ should deviate from $\mu$ with a variance that involves two variances so add up these two and get $\sigma^2=\sigma^2_t+\frac{\sigma^2}{n}$. By solving this, we get $\sigma^2=\sigma^2_t \times\frac{n}{n-1}$. Replacing $\sigma^2_t$ gives our estimator for population variance:

$S^2= \frac{\sum_{i}^{n}(X_i-\overline{X})^2}{n-1}$.

One can also prove that $E[S^2]=\sigma^2$ is true.

• Comments are not for extended discussion; this conversation has been moved to chat. May 18 at 11:16

A common one is that the definition of variance (of a distribution) is the second moment recentered around a known, definite mean, whereas the estimator uses an estimated mean. This loss of a degree of freedom (given the mean, you can reconstitute the dataset with knowledge of just $n-1$ of the data values) requires the use of $n-1$ rather than $n$ to "adjust" the result.

Such an explanation is consistent with the estimated variances in ANOVA and variance components analysis. It's really just a special case.

The need to make some adjustment that inflates the variance can, I think, be made intuitively clear with a valid argument that isn't just ex post facto hand-waving. (I recollect that Student may have made such an argument in his 1908 paper on the t-test.) Why the adjustment to the variance should be exactly a factor of $n/(n-1)$ is harder to justify, especially when you consider that the adjusted SD is not an unbiased estimator. (It is merely the square root of an unbiased estimator of the variance. Being unbiased usually does not survive a nonlinear transformation.) So, in fact, the correct adjustment to the SD to remove its bias is not a factor of $\sqrt{n/(n-1)}$ at all!

Some introductory textbooks don't even bother introducing the adjusted sd: they teach one formula (divide by $n$). I first reacted negatively to that when teaching from such a book but grew to appreciate the wisdom: to focus on the concepts and applications, the authors strip out all inessential mathematical niceties. It turns out that nothing is hurt and nobody is misled.

• Thank you Whuber. I have to teach the students with the n-1 correction, so dividing in n alone is not an option. As written before me, to mention the connection to the second moment is not an option. Although to mention how the mean was already estimated thereby leaving us with less "data" for the sd - that's important. Regarding the bias of the sd - I remembered encountering it - thanks for driving that point home. Best, Tal Oct 24, 2010 at 7:15
• @Tal I was writing in your language, not that of your students, because I am confident you are fully capable of translating it into whatever you know will reach them. In other words, I interpreted "intuitive" in your question to mean intuitive to you.
– whuber
Oct 24, 2010 at 15:40
• Hi Whuber. Thank you for the vote of confidence :). The loose of the degree of freedom for the estimation of the expectancy is one that I was thinking of using in class. The problem is that the concept of "degrees of freedom" by itself is one that needs knowledge/intuition. But combining it with some of the other answers given in this thread will be useful (to me, and I hope others in the future). Best, Tal Oct 24, 2010 at 21:12
• For large $n$, there isn't typically much difference between dividing by $n$ or $n-1$, so it would be acceptable to introduce the uncorrected formula provided it was intended to apply to large samples, no? Sep 16, 2017 at 14:45
• @Patrick You might be reading too much into my answer, because it is explicit about the reasons: they are pedagogical and have nothing to do with whether $n$ is large or not.
– whuber
Sep 18, 2017 at 12:58

This is a total intuition, but the simplest answer is that is a correction made to make standard deviation of one-element sample undefined rather than 0.

• Why not, then, use $\frac{n}{n^2-1}$ or even $\frac{1}{\exp(1)-\exp(1/n)}$ as corrections? :-)
– whuber
Sep 22, 2011 at 6:25
• @whuber Parsimony (-;
– user88
Sep 22, 2011 at 10:17
• $\frac{1}{n-1}$ is even more "parsimonious". :-)
– whuber
Sep 22, 2011 at 15:02
• @mbq, Regarding your answer ~"it's a correction made to make standard deviation of one-element sample undefined rather than 0", is that really the reason why, or is this a joke answer? You know non-mathers like us can't tell. Jun 3, 2015 at 11:56
• Formally, it is a consequence than reason, but, as i wrote, I find it to be a good intution to memorize it.
– user88
Jun 3, 2015 at 17:45

Why divide by $n-1$ rather than $n$? Because it is customary, and results in an unbiased estimate of the variance. However, it results in a biased (low) estimate of the standard deviation, as can be seen by applying Jensen's inequality to the concave function, square root.

So what's so great about having an unbiased estimator? It does not necessarily minimize mean square error. The MLE for a Normal distribution is to divide by $n$ rather than $n-1$. Teach your students to think, rather than to regurgitate and mindlessly apply antiquated notions from a century ago.

• (+1) The more I think about this situation (and I've given it some real thought, to the extent of researching the earlier papers such as Student's 1908 Biometrica contribution to try to track down when and why $n-1$ made its appearance), the more I think that "because it's customary" is the only possible correct answer. I am unhappy to see the downvotes and can only guess that they are responding to the last sentence, which could easily be seen as attacking the O.P., even though I doubt that was your intention.
– whuber
Aug 28, 2015 at 17:45
• My last sentence was friendly advice to all concerned, as opposed to an attack on the OP. Aug 29, 2015 at 1:50
• In much use it will not matter, when used in tests or for confidence intervals one would have to adjust other parts of the procedure and in the end obtain the same result! Aug 25, 2017 at 16:55
• (+1) It indeed does not minimise mean square error - if that is the goal one should instead divide by $n+1$. Jan 11, 2021 at 14:32

You can gain a deeper understanding of the $n-1$ term through geometry alone, not just why it's not $n$ but why it takes exactly this form, but you may first need to build up your intuition cope with $n$-dimensional geometry. From there, however, it's a small step to a deeper understanding of degrees of freedom in linear models (i.e. model df & residual df). I think there's little doubt that Fisher thought this way. Here's a book that builds it up gradually:

Saville DJ, Wood GR. Statistical methods: the geometric approach. 3rd edition. New York: Springer-Verlag; 1991. 560 pages. 9780387975177

(Yes, 560 pages. I did say gradually.)

• Thanks onestop - I didn't think there would be an answer from that direction. Any way to sum-up the intuition, or is that not likely to be possible? Cheers, Tal Oct 24, 2010 at 11:20
• I couldn't do so myself, but a book reviewer summarised the approach in a paragraph in Amer. Stat. in 1993: jstor.org/stable/2684984. I'm not sure it's really practical to use this approach with your students unless you adopt it for the entire course though. Oct 24, 2010 at 12:10
• Can you summarise a bit of the intuition rather than just a book reference? Sep 30, 2019 at 18:34

It is well-known (or easily proved) that the quadratic $$\alpha z^2 + 2\beta z + \gamma$$ has an extremum at $$z = -\frac{\beta}{\alpha}$$ which point is midway between the roots $$\frac{-\beta - \sqrt{\beta^2-\alpha\gamma}}{\alpha}$$ and $$\frac{-\beta + \sqrt{\beta^2-\alpha\gamma}}{\alpha}$$ of the quadratic. This shows that, for any given $$n$$ real numbers $$x_1, x_2, \ldots, x_n$$, the quantity $$G(a) = \sum_{i=1}^n (x_i-a)^2 = \left(\sum_{i=1}^n x_i^2\right) -2a\left(\sum_{i=1}^n x_i\right) + na^2,$$ has minimum value when $$\displaystyle a = \frac 1n \sum_{i=1}^n x_i =\bar{x}$$.

Now, suppose that the $$x_i$$ are a sample of size $$n$$ from a distribution with unknown mean $$\mu$$ and unknown variance $$\sigma^2$$. We can estimate $$\mu$$ as $$\frac 1n \sum_{i=1}^n x_i = \bar{x}$$ which is easy enough to calculate, but an attempt to estimate $$\sigma^2$$ as $$\frac 1n \sum_{i=1}^n (x_i-\mu)^2 = n^{-1}G(\mu)$$ encounters the problem that we don't know $$\mu$$. We can, of course, readily compute $$G(\bar{x})$$ and we know that $$G(\mu) \geq G(\bar{x})$$, but how much larger is $$G(\mu)$$? The answer is that $$G(\mu)$$ is larger than $$G(\bar{x})$$ by a factor of approximately $$\frac{n}{n-1}$$, that is, $$G(\mu) \approx \frac{n}{n-1}G(\bar{x})\tag{1}$$ and so the estimate $$\displaystyle n^{-1}G(\mu)= \frac 1n\sum_{i=1}^n(x_i-\mu)^2$$ for the variance of the distribution can be approximated by $$\displaystyle \frac{1}{n-1}G(\bar{x}) = \frac{1}{n-1}\sum_{i=1}^n (x_i-\bar{x})^2.$$

So, what is an intuitive explanation of $$(1)$$? Well, we have that \begin{align} G(\mu) &= \sum_{i=1}^n (x_i-\mu)^2\\ &= \sum_{i=1}^n (x_i-\bar{x} + \bar{x}-\mu)^2\\ &= \sum_{i=1}^n \left((x_i-\bar{x})^2 + (\bar{x}-\mu)^2 + 2(x_i-\bar{x})(\bar{x}-\mu)\right)\\ &= G(\bar{x}) + n(\bar{x}-\mu)^2 + (\bar{x}-\mu)\sum_{i=1}^n(x_i-\bar{x})\\ &= G(\bar{x}) + n(\bar{x}-\mu)^2 \tag{2} \end{align} since $$\sum_{i=1}^n (x_i-\bar{x}) = n\bar{x}-n\bar{x} = 0$$. Now, \begin{align} n(\bar{x}-\mu)^2 &= n\frac{1}{n^2}\left(\sum_{i=1}^n(x_i-\mu)\right)^2\\ &= \frac 1n \sum_{i=1}^n(x_i-\mu)^2 + \frac 2n \sum_{i=1}^n\sum_{j=i+1}^n(x_i-\mu)(x_j-\mu)\\ &= \frac 1n G(\mu) + \frac 2n \sum_{i=1}^n\sum_{j=i+1}^n(x_i-\mu)(x_j-\mu)\tag{3} \end{align} Except when we have an extraordinarily unusual sample in which all the $$x_i$$ are larger than $$\mu$$ (or they are all smaller than $$\mu$$), the summands $$(x_i-\mu)(x_j-\mu)$$ in the double sum on the right side of $$(3)$$ take on positive as well as negative values and thus a lot of cancellations occur. Thus, the double sum can be expected to have small absolute value, and we simply ignore it in comparison to the $$\frac 1nG(\mu)$$ term on the right side of $$(3)$$. Thus, $$(2)$$ becomes $$G(\mu) \approx G(\bar{x}) + \frac 1nG(\mu) \Longrightarrow G(\mu) \approx \frac{n}{n-1}G(\bar{x})$$ as claimed in $$(1)$$.

• Only on this stack exchange would this ever be considered an intuitive answer. Mar 13, 2017 at 3:15

The estimator of the population variance is biased when applied on a sample of the population. In order to adjust for that bias on needs to divide by n-1 instead of n. One can show mathematically that the estimator of the sample variance is unbiased when we divide by n-1 instead of n. A formal proof is provided here:

https://economictheoryblog.com/2012/06/28/latexlatexs2/

Initially it was the mathematical correctness that led to the formula, I suppose. However, if one wants to add intuition to a formula the already mentioned suggestions appear reasonable.

First, observations of a sample are on average closer to the sample mean than to the population mean. The variance estimator makes use of the sample mean and as a consequence underestimates the true variance of the population. Dividing by n-1 instead of n corrects for that bias.

Furthermore, dividing by n-1 make the variance of a one-element sample undefined rather than zero.

At the suggestion of whuber, this answer has been copied over from another similar question.

Bessel's correction is adopted to correct for bias in using the sample variance as an estimator of the true variance. The bias in the uncorrected statistic occurs because the sample mean is closer to the middle of the observations than the true mean, and so the squared deviations around the sample mean systematically underestimates the squared deviations around the true mean.

To see this phenomenon algebraically, just derive the expected value of a sample variance without Bessel's correction and see what it looks like. Letting $S_*^2$ denote the uncorrected sample variance (using $n$ as the denominator) we have:

\begin{aligned} S_*^2 &= \frac{1}{n} \sum_{i=1}^n (X_i - \bar{X})^2 \\[8pt] &= \frac{1}{n} \sum_{i=1}^n (X_i^2 - 2 \bar{X} X_i + \bar{X}^2) \\[8pt] &= \frac{1}{n} \Bigg( \sum_{i=1}^n X_i^2 - 2 \bar{X} \sum_{i=1}^n X_i + n \bar{X}^2 \Bigg) \\[8pt] &= \frac{1}{n} \Bigg( \sum_{i=1}^n X_i^2 - 2 n \bar{X}^2 + n \bar{X}^2 \Bigg) \\[8pt] &= \frac{1}{n} \Bigg( \sum_{i=1}^n X_i^2 - n \bar{X}^2 \Bigg) \\[8pt] &= \frac{1}{n} \sum_{i=1}^n X_i^2 - \bar{X}^2. \end{aligned}

Taking expectations yields:

\begin{aligned} \mathbb{E}(S_*^2) &= \frac{1}{n} \sum_{i=1}^n \mathbb{E}(X_i^2) - \mathbb{E} (\bar{X}^2) \\[8pt] &= \frac{1}{n} \sum_{i=1}^n (\mu^2 + \sigma^2) - (\mu^2 + \frac{\sigma^2}{n}) \\[8pt] &= (\mu^2 + \sigma^2) - (\mu^2 + \frac{\sigma^2}{n}) \\[8pt] &= \sigma^2 - \frac{\sigma^2}{n} \\[8pt] &= \frac{n-1}{n} \cdot \sigma^2 \\[8pt] \end{aligned}

So you can see that the uncorrected sample variance statistic underestimates the true variance $\sigma^2$. Bessel's correction replaces the denominator with $n-1$ which yields an unbiased estimator. In regression analysis this is extended to the more general case where the estimated mean is a linear function of multiple predictors, and in this latter case, the denominator is reduced further, for the lower number of degrees-of-freedom.

• Thanks for the proof! Jun 25, 2019 at 3:18

Sample variance can be thought of to be the exact mean of the pairwise "energy" $(x_i-x_j)^2/2$ between all sample points. The definition of sample variance then becomes $$s^2 = \frac{2}{n(n-1)}\sum_{i< j}\frac{(x_i-x_j)^2}{2} = \frac{1}{n-1}\sum_{i=1}^n(x_i-\bar{x})^2 .$$

This also agrees with defining variance of a random variable as the expectation of the pairwise energy, i.e. let $X$ and $Y$ be independent random variables with the same distribution, then $$V(X) = E\left(\frac{(X-Y)^2}{2}\right) = E((X-E(X))^2) .$$

To go from the random variable defintion of variance to the defintion of sample variance is a matter of estimating a expectation by a mean which is can be justified by the philosophical principle of typicality: The sample is a typical representation the distribution. (Note, this is related to, but not the same as estimation by moments.)

• I couldn't quite follow you at the last paragraph. Isn't mathematical fact that $V(X) = E\left(\frac{(X-Y)^2}{2}\right) = E((X-E(X))^2)$? Even though the equation is interesting, I don't get how it could be used to teach n-1 intuitively? Jun 17, 2012 at 1:59
• I like this approach, but it omits a key idea: to compute the mean energy between all pairs of sample points, one would have to count the values $(x_i-x_i)^2$, even though they are all zero. Thus the numerator of $s^2$ remains the same but the denominator ought to be $n$, not $n-1$. This shows the sleight-of-hand that has occurred: somehow, you need to justify not including such self-pairs. (Because they are included in the analogous population definition of variance, this is not an obvious thing.)
– whuber
Jun 24, 2015 at 17:24
• @whuber To complete this answer's argument in an intuitively elegant way: the self-pairs indeed are in the analogous population definition of variance as well, but their proportion tends to 0 as the number of possible pairs you could draw goes to infinity. Jul 20, 2020 at 10:56
• So to complete the answer I'd argue the opposite of @whuber final point: self-pairs must be excluded because they are not in the population variance either. Their proportion ${n \over {n^2}} = {1 \over n} \to 0$ as $n \to \inf$. The $n \over {n-1}$ factor corrects precisely for this over-representation of self-pairs in the sample vs the population. Of the $n^2$ pairs in a sample, $n$ are self-pairs, whereas $n^2 - n$ follow population variance. Hence we multiply $s^2$ by ${n^2 \over {n^2 - n}} = {n \over {n - 1}}$ to remove the self-pairs from the denominator. Jul 20, 2020 at 13:32
• @zwets I find your argument interesting but less than useful because of two flaws: You assume an infinite population (and such an assumption is both superfluous and overly restrictive) and you appear to confound the population size with the sample size, referring to both as $n.$
– whuber
Jul 20, 2020 at 14:02

Suppose that you have a random phenomenon. Suppose again that you only get one $N=1$ sample, or realization, $x$. Without further assumptions, your "only" reasonable choice for a sample average is $\overline{m}=x$. If you do not subtract $1$ from your denominator, the (uncorrect) sample variance would be $$V=\frac{\sum_N (x_n - \overline{m} )^2}{N}$$, or:

$$\overline{V}=\frac{(x-\overline{m})^2}{1} = 0\,.$$

Oddly, the variance would be null with only one sample. And having a second sample $y$ would risk to increase your variance, if $x\neq y$. This makes no sense. Intuitively, an infinite variance would be a sounder result, and you can recovered it only by "dividing by $N-1=0$".

Estimating a mean is fitting a polynomial with degree $0$ to the data, having one degree of freedom (dof). This Bessel's correction applies to higher degrees of freedom models too: of course you can fit perfectly $d+1$ points with a $d$ degree polynomial, with $d+1$ dofs. The illusion of a zero-squared-error can only be counterbalanced by dividing by the number of points minus the number of dofs. This issue is particularly sensitive when dealing with very small experimental datasets.

• It is unclear why "an infinite variance would be a sounder result" than a zero variance. Indeed, you seem to use "sample variance" in the sense of a variance estimator, which is more confusing yet.
– whuber
Jun 26, 2017 at 16:42
• I understand. To answer an intuitive explanation between two options, I tried to suggest that one of the two is somehow unacceptable, based on the mundane rule that $0 < \infty$. A rephrasing is indeed necessary, and upcoming Jun 26, 2017 at 18:33

The sample mean is defined as $\bar{X} = \frac{1}{n}\sum_{i=1}^{n} X_i$, which is quite intuitive. But the sample variance is $S^2 = \frac{1}{n-1}\sum_{i=1}^{n} (X_i - \bar{X})^2$. Where did the $n - 1$ come from ?

To answer this question, we must go back to the definition of an unbiased estimator. An unbiased estimator is one whose expectation tends to the true expectation. The sample mean is an unbiased estimator. To see why:

$$E[\bar{X}] = \frac{1}{n}\sum_{i=1}^{n} E[X_i] = \frac{n}{n} \mu = \mu$$

Let us look at the expectation of the sample variance,

$$S^2 = \frac{1}{n-1} \sum_{i=1}^{n} (X_i^2) - n\bar{X}^2$$

$$E[S^2] = \frac{1}{n-1} \left( n E[(X_i^2)] - nE[\bar{X}^2] \right).$$

Notice that $\bar{X}$ is a random variable and not a constant, so the expectation $E[\bar{X}^2]$ plays a role. This is the reason behind the $n-1$.

$$E[S^2] = \frac{1}{n-1} \left( n (\mu^2 + \sigma^2) - n(\mu^2 + Var(\bar{X})) \right).$$ $$Var(\bar{X}) = Var(\frac{1}{n}\sum_{i=1}^{n} X_i) = \sum_{i=1}^{n} \frac{1}{n^2} Var(X_i) = \frac{\sigma^2}{n}$$

$$E[S^2] = \frac{1}{n-1} \left( n (\mu^2 + \sigma^2) - n(\mu^2 + \sigma^2/n) \right). = \frac{(n-1)\sigma^2}{n-1} = \sigma^2 \\$$

As you can see, if we had the denominator as $n$ instead of $n-1$, we would get a biased estimate for the variance! But with $n-1$ the estimator $S^2$ is an unbiased estimator.

• But it doesn't follow that $S$ is an unbiased estimator of the standard deviation. Jan 15, 2016 at 17:32

Generally using "n" in the denominator gives smaller values than the population variance which is what we want to estimate. This especially happens if the small samples are taken. In the language of statistics, we say that the sample variance provides a “biased” estimate of the population variance and needs to be made "unbiased".

If you are looking for an intuitive explanation, you should let your students see the reason for themselves by actually taking samples! Watch this, it precisely answers your question.

The intuitive reason for the $$n-1$$ is that the $$n$$ deviations in the calculation of the standard deviation are not independent. There is one constraint which is that the sum of the deviations is zero. When we take that into account we are effectively dealing with $$n-1$$ quantities rather than $$n$$. (Geometrically the deviation vector $$x-\bar{x}$$ is the projection of $$x$$ onto the space orthogonal to the space spanned by the vector of all ones and the space onto which it projects has dimension $$n-1$$.)

I think it's worth pointing out the connection to Bayesian estimation. Suppose you assume your data is Gaussian, and so you measure the mean $\mu$ and variance $\sigma^2$ of a sample of $n$ points. You want to draw conclusions about the population. The Bayesian approach would be to evaluate the posterior predictive distribution over the sample, which is a generalized Student's T distribution (the origin of the T-test). This distribution has mean $\mu$, and variance $$\sigma^2 \left(\frac{n+1}{n-1}\right),$$

which is even larger than the typical correction. (It has $2n$ degrees of freedom.)

The generalized Student's T distribution has three parameters and makes use of all three of your statistics. If you decide to throw out some information, you can further approximate your data using a two-parameter normal distribution as described in your question.

From a Bayesian standpoint, you can imagine that uncertainty in the hyperparameters of the model (distributions over the mean and variance) cause the variance of the posterior predictive to be greater than the population variance.

I'm jumping VERY late into this, but would like to offer an answer that is possibly more intuitive than others, albeit incomplete.

As others asserted, the population mean ($$\mu$$) and the sample mean ($$\overline{X}$$) are going to differ (where the larger the sample size the smaller the difference).

Let $$e$$ be the difference (or error) between the population and sample means:

$$e = \mu - \overline{X}$$

After rearranging:

$$\overline{X} = \mu - e$$

Thus:

$$(X_i-\overline{X})^2 = (X_i-(\mu - e))^2 = (X_i - \mu + e)^2$$

In other words $$(X_i-\overline{X})^2$$ conceals an error: $$(X_i - \mu + e)^2$$.

What does this result in?

The table below shows a population of $$\{2, 4, 6\}$$, so $$\mu = 4$$, and three possible sample means ($$\overline{X}$$):

• $$4\ (e = 0)$$
• $$3.5\ (e = -0.5)$$
• $$4.5\ (e = 0.5)$$

The (non-bold) numeric cells shows the squared difference. For example, with $$X_1 = 2$$ and $$\overline{X} = 3.5$$, $$(X_i-\overline{X})^2 = 2.25$$.

The bottom row shows the sum of squares (the numerator in $$\frac{\sum(X_i-\overline{X})^2}{n}$$), and as you can see, whenever there's an error, it is "overestimated".

To compensate for this, we have to take away something from the denominator.

$$\begin{array}{|c|c|c|c|} \hline & \overline{X} = \mu = 4 & \overline{X} = 3.5 & \overline{X} = 4.5 \\ \hline X_1 = 2 & 4 & 2.25 & 6.25 \\ \hline X_2 = 4 & 0 & 0.25 & 0.25 \\ \hline X_3 = 6 & 4 & 6.25 & 2.25 \\ \hline \sum(X_i-\overline{X})^2 & \textbf{8} & \textbf{8.75} & \textbf{8.75} \\ \hline \end{array}$$

My goodness it's getting complicated! I thought the simple answer was... if you have all the data points you can use "n" but if you have a "sample" then, assuming it's a random sample, you've got more sample points from inside the standard deviation than from outside (the definition of standard deviation). You just don't have enough data outside to ensure you get all the data points you need randomly. The n-1 helps expand toward the "real" standard deviation.

• This doesn't make sense. More points from inside the SD than outside? If that means within 1 SD of the mean versus not within, whether that is true has nothing to do with taking a sample. For necessary constraints on fractions within intervals around the mean, see Chebyshev's inequality. To the main question here, "helps expand" doesn't explain $n - 1$ at all, as even granting your argument $n - 2$ might be better still, and so forth, as there is no algebra here, even implicitly. Unfortunately this adds nothing to other answers except a confused set of ideas, either incorrect or irrelevant. Apr 7, 2016 at 1:41