Computes the correlation coefficient between two sets of values.
Syntax
1corr(<Y>, <X>)
Arguments
Required
<Y>: A double precision expression representing the dependent variable.
<X>: A double precision expression representing the independent variable.
Returns
Returns a double precision value representing the correlation coefficient, ranging from -1 to 1. Returns NULL if the computation is meaningless (e.g., no valid input pairs).
Considerations
Returns NULL if there are no rows where both X and Y are non-null.
A value of 1 indicates perfect positive correlation.
A value of -1 indicates perfect negative correlation.