How to find the Mean and Standard Deviation

Suppose we have a list of numbers. We will assume that the end of the list is indicated by the value -555.00.

We will need some variables. The first three are all initially set to 0.0:

         COUNT = the number of points (not including -555.00)

         SUMX = sum of all the X values (not including -555.00)

         SUMX2 = sum of the squares of the X values (not including -555.00)

Now we can find the Mean value:

         MEAN = SumX / Count

We can find the variance and the standard deviation:

         VARIANCE = SUMX2 / COUNT - MEAN ** 2
         STDEV = square root of VARIANCE


Example

Suppose our list looks like this:

       7.0
       15.0
       28.0
     -555.00

Then:

     Count = 3

     SumX = 7.0 + 15.0 + 28.0 = 50.0

     SumX2 = 49.0 + 225.0 + 784.0 = 1058.0

     VARIANCE = 1058.0 / 3 - (50.0 / 3) ** 2 = 74.889

     STDDEV = square root of 74.889 = 8.653


Why are the mean and standard deviation of interest?

Another word for "mean" is "average". The mean value tells us "where is the middle of the list", more or less. (There are other statistics that try to tells us the same thing.)

The standard deviation is a measure of "how the numbers are spread out around the mean". (Again, there are other statistics--such as the variance--that try to do the same thing.)