# What is the difference between N and N-1 in calculating population variance?

I did not get the why there are N and N-1 while calculating population variance. When we use N and when we use N-1?

It says that when population is very big there is no difference between N and N-1 but it does not tell why is there N-1 at the beginning.

Edit: Please don't confuse with n and n-1 which are used in estimating.

Edit2: I'm not talking about population estimation.

-
You can find an answer there: stats.stackexchange.com/questions/16008/…. Basically, you should use N-1 when you estimate a variance, and N when you compute it exactly. – ocram Nov 3 '11 at 15:10
@ocram, as far as I know when we estimate a variance we use either n or n-1. – george Nov 3 '11 at 16:06
If you want your estimator to be unbiased, then you should use n-1. Note that when n is large, this is not a matter. – ocram Nov 3 '11 at 16:11
None of the answers below are written in terms of finite population inference. The word finite is absolutely crucial here; that's what Kish's book is about (and whoever was saying "The book is wrong" simply don't know enough about finite population surveys and samples). The quotient $N-1$ instead of $N$ just makes computations nicer and obviates the need to haul around factors like $1-1/N$. The full answer to this question would have to introduce the sampling inference where the sample indicators are random, and the values of observed characteristics $y$ are FIXED. Non-random. Set in stone. – StasK May 16 at 11:25

$N$ is the population size and $n$ is the sample size. The question asks why the population variance is the mean squared deviation from the mean rather than $(N-1)/N = 1-(1/N)$ times it. For that matter, why stop there? Why not multiply the mean squared deviation by $1-2/N$, or $1-17/N$, or $\exp(-1/N)$, for instance?

There actually is a good reason not to. Any of these figures I just mentioned would serve just fine as a way to quantify a "typical spread" within the population. However, without prior knowledge of the population size, it would be impossible to use a random sample to find an unbiased estimator of such a figure. We know that the sample variance, which multiplies the mean squared deviation from the sample mean by $(n-1)/n$, is an unbiased estimator of the usual population variance when sampling with replacement. (There is no problem with making this correction, because we know $n$!) The sample variance would therefore be a biased estimator of any multiple of the population variance where that multiple, such as $1-1/N$, is not exactly known beforehand.

This problem of some unknown amount of bias would propagate to all statistical tests that use the sample variance, including t-tests and F-tests. In effect, dividing by anything other than $N$ in the population variance formula would require us to change all statistical tabulations of t-statistics and F-statistics (and many other tables as well), but the adjustment would depend on the population size. Nobody wants to have to make tables for every possible $N$! Especially when it's not necessary.

As a practical matter, when $N$ is small enough that using $N-1$ instead of $N$ in formulas makes a difference, you usually do know the population size (or can guess it accurately) and you would likely resort to much more substantial small-population corrections when working with random samples (without replacement) from the population. In all other cases, who cares? The difference doesn't matter. For these reasons, guided by pedagogical considerations (namely, of focusing on details that matter and glossing over details that don't), some excellent introductory statistics texts don't even bother to teach the difference: they simply provide a single variance formula (divide by $N$ or $n$ as the case may be).

-

There has, in the past been an argument that you should use N for a non-inferential variance but I wouldn't recommended that anymore. You should always use N-1. As sample size decreases N-1 is a pretty good correction for the fact that the sample variance gets lower (you're just more likely to sample near the peak of the distribution---see figure). If sample size is really big then it doesn't matter any meaningful amount.

An alternative explanation is that the population is a theoretical construct that's impossible to achieve. Therefore, always use N-1 because whatever you're doing you're, at best, estimating the population variance.

Also, you're going to be seeing N-1 for variance estimates from here on in. You'll likely not ever encounter this issue... except on a test when your teacher might ask you to make a distinction between an inferential and non-inferential variance measure. In that case don't use whuber's answer or mine, refer to ttnphns's answer.

Note, in this figure the variance should be close to 1. Look how much it varies with sample size when you use N to estimate the variance. (this is the "bias" referred to elswhere)

-
Please, tell me why N "not recommended anymore" with true population at hand? Population is not always a theoretical construct. Sometimes your sample is a bona fide population for you. – ttnphns Nov 3 '11 at 17:10
@John, can you please remove everything related with "estimation", "estimating", and "sample"? The question is about population itself. No estimation, no sampling, no samples. And please use "n" when referring to sample size. "N" is used for population size. Correct me if I'm wrong. – george Nov 3 '11 at 17:17
ilhan, N can be used for your sample, or it can be used for the population size, if one exists. In most cases the distinction between big N and small n is dependent upon the topic. For example, n might be the number of cases in each condition in an experiment while N might be the number for the experiment. They're both samples. There is no global rule. – John Nov 3 '11 at 17:39
ttnphns, it depends on what you mean by population. I would argue that if your whole population is so small that N-1 matters then it's questionable whether calculating a mean squared deviation is remotely useful at all. Show all the values, their shape and range. Furthermore, the whole old argument that you actually have N degrees of freedom if you're not making an inference is questionable. You lost one when you calculated the mean, that you needed to calculate the variance. – John Nov 3 '11 at 17:42
@ilhan Please, consider updating your question (as you did) and point to the updated version rather than leaving such non-constructive comments. Everything is debatable, especially when the question itself lacks some context. Here it seems that the problem stands from defining what a population really is. – chl Nov 3 '11 at 22:41

Instead of going into maths I'll try to put it in plain words. If you have the whole population at your disposal then its variance (population variance) is computed with the denominator N. Likewise, if you have only sample and want to compute this sample variance, you use denominator N. In both cases, note, you don't estimate anything: the mean that you measured is the true mean and the variance you computed from that mean is the true variance.

Now, you have only sample and want to infer about the unknown mean and variance in the population. In other words, you want estimates. You take your sample mean for the estimate of population mean (because your sample is representative), OK. To obtain estimate of population variance, you have to pretend that that mean is really population mean and therefore it is not dependent on your sample anymore since when you computed it. To "show" that you now take it as fixed you reserve one (any) observation from your sample to "support" the mean's value: whatever your sample might have happened, one reserved observation could always bring the mean to the value that you've got and which believe is insensitive to sampling contingencies. One reserved observation is "-1" and so you have N-1 in computing variance estimate.

Imagine that you somehow know the true population mean, but want to estimate variance from the sample. Then you will substitute that true mean into the formula for variance and apply denominator N: no "-1" is needed here since you know the true mean, you didn't estimate it from this same sample.

-
 But my question has nothing to do with estimation. It is about computing population variance; with N and N-1. I'm not talking about n and n-1. – george Nov 3 '11 at 16:12 @ilhan, in my reply, I used N for both N and n. N is a size of a totality at hand, either population or sample. To compute population variance, you must have population at your disposal. If you have only sample you can either compute this sample's variance or compute population estimate variance. No other way round. – ttnphns Nov 3 '11 at 16:21 I have a complete information about my population; all the values are know. I'm not interested in estimation. – george Nov 3 '11 at 16:35 If you do have your population then use N. N-1 would be illogical to use. – ttnphns Nov 3 '11 at 17:00 Kish does not say so i.imgur.com/OpAVd.jpg – george Nov 3 '11 at 17:08
I'm sorry, but that book is using the terms incorrectly. $S^2$ is the sample variance, NOT population variance. $\sigma^2$ is the population variance. When estimating $\sigma^2$, you should always use $N$ as denominator, and never $N-1$. For sample variance $n-1$ should be always used because the sample variance underestimates the population variance.
I think "When estimating $σ^2$, you should always use $N$ as denominator," is wrong or at least misleading. When computing $s^2$ you are estimating $\sigma^2$. If you have the population, you're not estimating anything, you're computing the actual value. – Glen_b May 16 at 7:53