Free Hosting : Credit & Debt : Free Web Hosting : Best Credit Cards  

Calculating the Mean and Standard Deviation


[Summary] [Algorithm] [Example]

Summary


Algorithm

  1. Make a table with five (5) columns and one row for each observation.
  2. Label the first column n, the second column X, the third column d, the fourth column M, and the fifth column SS.
  3. Write "1" in the n column, the 1st observation in the X column and the M column, and 0 in the d and SS columns.
  4. For each observation after the first, write
    1. the observation sequence number in the n column. (This column will have the entries 1,2,... when finished.)
    2. the next observation in the X column
    3. (X - M)/n in the d column. (using the M from the previous row)
    4. M + d in the M column, using the M from the previous row again.
    5. SS + n(n-1)d in the SS column. (using the SS from the previous row)
  5. When you have finished, divide the SS from the last row by (n-1). This result is the variance of X from this sample.
  6. Take its square root. This number is the standard deviation of X from this sample.

Example

nXdMSS
17000
29182
38082
48082
57-0.27.82.8
690.284.0
SS / (n-1) = 4.0 / 5 = 0.8
and the square root of 0.8 is (approximately) 0.894 which is the sd.
DickBeldin@prdigital.com