v.21.1New Features

Added Statistical Aggregate Functions and Refactored Rank Correlation

Added mannWitneyUTest, studentTTest and welchTTest aggregate functions. Refactored rankCorr a bit. #16883 (Nikita Mikhaylov).
Added new aggregate functions mannWitneyUTest, studentTTest, and welchTTest for performing statistical hypothesis testing. Also refactored the existing rankCorr function.

Why it matters

These new aggregate functions provide users with built-in capabilities to perform common statistical tests within ClickHouse, enabling more advanced data analysis and inference directly in SQL queries without needing external tools.

How to use it

Use the new aggregate functions in your queries like any other aggregate function. For example, to perform a Mann-Whitney U test, use:

SELECT mannWitneyUTest(column1, column2) FROM table_name

Similarly, use studentTTest and welchTTest for their respective tests applied to your dataset columns.