theilsU
Introduced in: v22.1.0
The theilsU function calculates the Theil’s U uncertainty coefficient, a value that measures the association between two columns in a table.
Its values range from 0.0 (no association) to 1.0 (perfect agreement).
Syntax
theilsU(column1, column2)
Arguments
column1 — First column to be compared. Any
column2 — Second column to be compared. Any
Returned value
Returns a value between 0 and 1. Float64
Examples
Usage example
SELECT theilsU(a, b)
FROM (
SELECT
number % 10 AS a,
number % 4 AS b
FROM
numbers(150)
);
┌────────theilsU(a, b)─┐
│ 0.30195720557678846 │
└──────────────────────┘
Last modified on June 8, 2026