# oneWayAnova

> **oneWayAnova**(`groups`): [`OneWayAnovaResult`](/reference/knotkit/hypothesis-test/interfaces/onewayanovaresult/)

Defined in: [packages/hypothesis-test/src/one-way-anova.ts:30](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/hypothesis-test/src/one-way-anova.ts#L30)

One-way analysis of variance of whether `k >= 2` independent groups share a mean, matching `scipy.stats.f_oneway`. The p-value is the upper tail of the F distribution, so there is no `alternative`. Groups may have different sizes and a group may hold a single value, provided the total exceeds `k`. Uses O(N) time and constant working storage for `N` observations.

When every group is constant, the within-group mean square is zero. SciPy returns NaN or an infinite statistic there; this function throws.

## Parameters

### groups

`ArrayLike`<`ArrayLike`<`number`>>

## Returns

[`OneWayAnovaResult`](/reference/knotkit/hypothesis-test/interfaces/onewayanovaresult/)

## Throws

With `TOO_FEW_GROUPS` below two groups, `EMPTY_SAMPLE`, `TOO_SMALL_SAMPLE` when the observations do not exceed the group count, `NON_FINITE_SAMPLE`, or `ZERO_VARIANCE`.

## Throws

With `INVALID_PARAMETER` above 1e5 degrees of freedom.
