COBOL Manual for TNS and TNS/R Programs
Intrinsic Functions
HP COBOL Manual for TNS and TNS/R Programs—522555-006
14-56
STANDARD-DEVIATION Function
STANDARD-DEVIATION Function
STANDARD-DEVIATION, a numeric function, returns a value that approximates the
standard deviation of its arguments.
argument
is a numeric argument.
argument can be an array; for example,
FUNCTION STANDARD-DEVIATION (ARRAY1(ALL))
returns a value that approximates the standard deviation of the elements of the
array ARRAY1.
The returned value is the approximation of the standard deviation of the argument
series.
If there is only one argument, or if every argument is a variable occurrence data
item and the total number of occurrences for all of them is one, the returned value is
zero; otherwise, the returned value is approximately
where n is the number of arguments.
Note. This function requires the CRE. To use this function in a TNS HP COBOL program,
compile the program with the directive ENV COMMON.
( )
STANDARD-DEVIATIONFUNCTION argument
VST462.vsd
argument
i
FUNCTION MEAN argument
1
… argument,
n
(, )–()
2
i 1=
n
∑
n
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------