mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-12 01:12:12 +00:00
df3cca6c35
Typo
1.2 KiB
1.2 KiB
slug | sidebar_position |
---|---|
/en/sql-reference/aggregate-functions/reference/theilsu | 353 |
theilsU
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 −1.0 (100% negative association, or perfect inversion) to +1.0 (100% positive association, or perfect agreement). A value of 0.0 indicates the absence of association.
Syntax
theilsU(column1, column2)
Arguments
column1
andcolumn2
are the columns to be compared
Returned value
- a value between -1 and 1
Return type is always Float64.
Example
The following two columns being compared below have a small association with each other, so the value of theilsU
is negative:
SELECT
theilsU(a ,b)
FROM
(
SELECT
number % 10 AS a,
number % 4 AS b
FROM
numbers(150)
);
Result:
┌────────theilsU(a, b)─┐
│ -0.30195720557678846 │
└──────────────────────┘