CORR

Returns the DOUBLE PRECISION coefficient of correlation of a set of expression pairs. CORR eliminates expression pairs where either expression in the pair is NULL. If no rows remain, the function returns NULL.

The approach CORR uses for calculating the correlation is Pearson Correlation Coefficient.

Syntax

CORR ( expression1, expression2 )

Parameters

expression1 The dependent DOUBLE PRECISION expression
expression2 The independent DOUBLE PRECISION expression

Example

=> SELECT CORR (Annual_salary, Employee_age) FROM employee_dimension;
         CORR
----------------------
 -0.00719153413192422
(1 row)