I was reading some statistics book that said - "Usually, it is expensive to perform an analysis on an entire population; hence, most statistical methods are about drawing conclusions about a population by analyzing a sample." and went on to give this formula for sample variance:
$$\frac{1}{N-1} \sum_{i=1}^{N}(x_i - \mu)^2$$
with the explanation - "The reason to use denominator N-1 for a sample instead of N, is the degrees of freedom."
I looked-up "degrees of freedom", I found many explanations, and this is what I could understand - If we are asked to choose a sample of "n" values knowing the mean has to be some "x", we are actually only free to choose "n-1" values. But I cant seem to extend this understanding to the above calculation of sample variance;
I have a population of size "P" and I randomly choose a sample of size "N". Now that I have already chosen my sample the variance of this sample, by definition of variance should be $\frac{1}{N}\sum_{i=1}^N(x_i - \mu)^2$. If I replace N with N-1, how is that the variance of the sample?
I might be missing some prerequisite knowledge here, I am not sure.
Thank you in advance!