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

> The result of the `cramersV` function ranges from 0 (corresponding to no association between the variables) to 1 and can reach 1 only when each value is completely determined by the other. It may be viewed as the association between two variables as a percentage of their maximum possible variation.

# cramersV

<h2 id="cramersV">
  cramersV
</h2>

Introduced in: v22.1.0

[Cramer's V](https://en.wikipedia.org/wiki/Cram%C3%A9r%27s_V) (sometimes referred to as Cramer's phi) is a measure of association between two columns in a table.
The result of the `cramersV` function ranges from 0 (corresponding to no association between the variables) to 1 and can reach 1 only when each value is completely determined by the other.
It may be viewed as the association between two variables as a percentage of their maximum possible variation.

<Note>
  For a bias corrected version of Cramer's V see: [cramersVBiasCorrected](/reference/functions/aggregate-functions/cramersVBiasCorrected)
</Note>

**Syntax**

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

**Arguments**

* `column1` — First column to be compared. [`(U)Int*`](/reference/data-types/int-uint) or [`Float*`](/reference/data-types/float) or [`Decimal`](/reference/data-types/decimal)
* `column2` — Second column to be compared. [`(U)Int*`](/reference/data-types/int-uint) or [`Float*`](/reference/data-types/float) or [`Decimal`](/reference/data-types/decimal)

**Returned value**

Returns a value between 0 (corresponding to no association between the columns' values) to 1 (complete association). [`Float64`](/reference/data-types/float)

**Examples**

**No association between columns**

```sql title=Query theme={null}
SELECT
    cramersV(a, b)
FROM
    (
        SELECT
            number % 3 AS a,
            number % 5 AS b
        FROM
            numbers(150)
    );
```

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

**High association between columns**

```sql title=Query theme={null}
SELECT
    cramersV(a, b)
FROM
    (
        SELECT
            number % 10 AS a,
            if (number % 12 = 0, (number + 1) % 5, number % 5) AS b
        FROM
            numbers(150)
    );
```

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