Sample Standard Deviation In Terms of Sum and Square Sum of Samples

I’m going to derive the formula for the sample standard deviation in terms of the sum and the sum of squares.

Let us start from the formula, SN=1N1i=1N(xix¯)2 where x¯=1Ni=1Nxi.

Expand the expression inside the summation to obtain: SN2=1N1i=1N(xix¯)2=1N1i=1N(xi22xix¯+x¯2) Now separate terms: SN2=1N1i=1Nxi22x¯N1i=1Nxi+1N1i=1Nx¯2.

Notice Nx¯=i=1Nxi. Substituting the left hand side of this equation into the second term and substituting the right hand side of i=1Nx¯2=Nx¯2 into the third term yields: SN2=1N1i=1Nxi22Nx¯2N1+Nx¯2N1

Hence, SN2=1N1i=1Nxi2NN1x¯2 or SN=1N1i=1Nxi21N(N1)(i=1Nxi)2 as desired.