How to Calculate Standard Deviation

How to Calculate Standard Deviation

First, view my test application here:  https://creator.zoho.com/niskypto/stdev

This calculates standard deviation in the same way Excel does. Specifically using n-1 degrees of freedom, which is preferred. 

I also added a 95% CI check for any value entered.

The function makes use of Creator's new aggregate record commands
  1. float calcstdev()
  2. {
  3.     n = DATA_ENTRY.count();
  4.     average = DATA_ENTRY.avg(Enter_a_Number);
  5.     residuals = (0.1  -  0.1);
  6.     for each x in DATA_ENTRY
  7.     {
  8.         residuals = ((x.Enter_a_Number  -  average).power(2)  +  residuals);
  9.     }
  10.     Stdev = (residuals  /  (n  -  1)).sqrt().round(3);
  11.     return Stdev;
  12. }
  • n = counts the number of entries
  • average is average
  • residuals starts off as zero, but has to be a decimal (long) data-type. Creator does not have a way to specify the necessary datatype without explicitly giving the variable a value. So that's why I had to use the 0.1 - 0.1 workaround.
  • Stdev is the standard deviation (or σ)
Hope you find this of value.

John M. Whitney