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

> Provides a statistical test for one-way analysis of variance (ANOVA test). It is a test over several groups of normally distributed observations to find out whether all groups have the same mean or not.

# analysisOfVariance

<h2 id="analysisOfVariance">
  analysisOfVariance
</h2>

Introduced in: v22.10.0

Provides a statistical test for one-way analysis of variance (ANOVA test). It is a test over several groups of normally distributed observations to find out whether all groups have the same mean or not.

<Note>
  Groups are enumerated starting from 0 and there should be at least two groups to perform a test.
  There should be at least one group with the number of observations greater than one.
</Note>

**Syntax**

```sql theme={null}
analysisOfVariance(val, group_no)
```

**Aliases**: `anova`

**Arguments**

* `val` — Value. [`(U)Int*`](/reference/data-types/int-uint) or [`Float*`](/reference/data-types/float) or [`Decimal`](/reference/data-types/decimal)
* `group_no` — Group number that `val` belongs to. [`(U)Int*`](/reference/data-types/int-uint) or [`Float*`](/reference/data-types/float) or [`Decimal`](/reference/data-types/decimal)

**Returned value**

Returns a tuple with the F-statistic and p-value. [`Tuple(Float64, Float64)`](/reference/data-types/tuple)

**Examples**

**Basic usage**

```sql title=Query theme={null}
SELECT analysisOfVariance(number, number % 2) FROM numbers(1048575);
```

```response title=Response theme={null}
┌─analysisOfVariance(number, modulo(number, 2))─┐
│ (0,1)                                         │
└───────────────────────────────────────────────┘
```
