Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

VARIANCE - Variance of arguments

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

  1. argument-1 must be class "numeric".

Returned values

  1. The returned value is the approximation of the variance of the argument series.

  2. The returned value is defined as the square of the standard deviation of the argument series (see STANDARD-DEVIATION function).

  3. 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.

  4. 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