> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8c05c8a2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> `theilsU` 関数は、Theils' U 不確実性係数を計算します。これは、テーブル内の 2 つのカラム間の関連性を表す値です。

# theilsU

<div id="theilsU">
  ## theilsU
</div>

導入バージョン: v22.1.0

`theilsU` 関数は、[Theil's U 不確実性係数](https://en.wikipedia.org/wiki/Contingency_table#Uncertainty_coefficient)を計算します。これは、テーブル内の 2 つのカラム間の関連性を表す値です。
値は 0.0 (関連性なし) から 1.0 (完全一致) までの範囲を取ります。

**構文**

```sql theme={null}
theilsU(column1, column2)
```

**引数**

* `column1` — 比較対象の最初のカラム。[`Any`](/ja/reference/data-types/index)
* `column2` — 比較対象の2番目のカラム。[`Any`](/ja/reference/data-types/index)

**戻り値**

0 から 1 までの値を返します。[`Float64`](/ja/reference/data-types/float)

**例**

**使用例**

```sql title=Query theme={null}
SELECT theilsU(a, b)
FROM (
    SELECT
        number % 10 AS a,
        number % 4 AS b
    FROM
        numbers(150)
);
```

```response title=Response theme={null}
┌────────theilsU(a, b)─┐
│  0.30195720557678846 │
└──────────────────────┘
```
