v.20.9New Feature

Added rankCorr Aggregate Function for Rank Correlation Coefficient

Added an aggregate function rankCorr which computes a rank correlation coefficient. #11769 (antikvist) #14411 (Nikita Mikhaylov).
Added a new aggregate function rankCorr that computes a rank correlation coefficient between two data sets.

Why it matters

The rankCorr function provides a statistical measure of the relationship between two variables based on their ranks. It helps users to understand the strength and direction of association in their data without assuming a linear relationship, which is valuable for non-parametric correlation analysis directly within ClickHouse queries.

How to use it

Use the rankCorr function in an aggregate context by passing two columns or expressions to it, for example:

SELECT rankCorr(column1, column2) FROM table_name;