Loading...
Select Version
The VARIANCE function returns a numeric value that approximates the variance of its arguments.
The type of this function is numeric.
Format
FUNCTION
VARIANCE
({argument-1}...)
Argument
argument-1 must be class "numeric".
Returned values
The returned value is the approximation of the variance of the argument series.
The returned value is defined as the square of the standard deviation of the argument series (see STANDARD-DEVIATION function).
If the argument series consists of only one value, or if the argument series consists of all variable occurrence data items and the total number of occurrences for all of them is one, the returned value is zero.
The error default value is
-
1.
See also: STANDARD-DEVIATION
Example 9-47
... DATA DIVISION. WORKING-STORAGE SECTION. 01 R PIC 99V9999. 01 RES PIC 99.9999. PROCEDURE DIVISION. P1 SECTION. MAIN. COMPUTE R = FUNCTION VARIANCE (2 4 6). MOVE R TO RES. DISPLAY RES UPON T. STOP RUN.
Result: 02.6666