Why do we average by divivding by n-1 rather than n in calculating the variance? the formula I am using is s^2=[ sum of (x- X)^2]/(n-1) where X= mean. Thank you very much for your help!

Printable View

- August 7th 2007, 07:22 AM0123variance and standard deviation
Why do we average by divivding by n-1 rather than n in calculating the variance? the formula I am using is s^2=[ sum of (x- X)^2]/(n-1) where X= mean. Thank you very much for your help!

- August 7th 2007, 08:07 AMCaptainBlack
- August 7th 2007, 11:21 AM0123
could you be more clear? because I do not understand why it is unbiased in the case on n-1. Thanks again.

- August 7th 2007, 12:03 PMCaptainBlack
Take my word for it, the proof is longer than I am prepared to reproduce here.

I can illustrate it by example:

Code:`>x=normal(100,5);`

>m=sum(x)/5; ..100 means of samples of size 5

>v=sum(x^2)/5-m^2; ..100 (1/n) variances of samples of size 5

>vv=sum(s')/100 .. average of 100 (1/n) variance of sample of size 5

0.80403236

>vv*5/4 .. corrected to 1/(n-1) variances

1.00504045

>

variance 1 is ~0.8, while the corrected average variance is ~1, as required.

RonL