The schema is SYSIBM.
The CORRELATION function returns the coefficient of correlation of a set of number pairs.
The argument values must be numbers.
If either argument is decimal floating-point, the result is DECFLOAT(34); otherwise, the result is a double-precision floating-point number. The result can be null. When not null, the result is between -1 and 1.
The function is applied to the set of (expression1, expression2) pairs derived from the argument values by the elimination of all pairs for which either expression1 or expression2 is null.
COVARIANCE(expression1,expression2)/
(STDDEV(expression1)*
STDDEV(expression2))
The order in which the values are aggregated is undefined, but every intermediate result must be within the range of the result data type.
CORR can be specified in place of CORRELATION.
Example:
SELECT CORRELATION(SALARY, BONUS)
INTO :CORRLN
FROM EMPLOYEE
WHERE WORKDEPT = 'A00'
CORRLN is set to approximately 9.99853953399538E-001 when using the sample table.