Previous Up Next

20.1.3  Standard deviation

Standard deviation is potentially better than variance to measure how close numbers are to their mean. The standard deviation is the square root of the variance; for example, the list [1,2,3,4] has mean 5/2, and so the standard deviation will be 2√5/4, since

  
(1−5/2)2+(2−5/2)2+(3−5/2)2+(4−5/2)2
4
=
2
5
4
.

Note that if the list of numbers have units, then the standard deviation will have the same unit.

The stddev command finds the standard deviation.

Examples

stddev([1,2,3,4])
     
5
2
          
stddev([1,2,3],[2,1,1])
     
4
16
 
11
          
stddev([[1,2],[3,6]])
     

1,2
          

Previous Up Next