# fisherExactTest

> **fisherExactTest**(`table`, `options?`): [`FisherExactTestResult`](/reference/knotkit/hypothesis-test/interfaces/fisherexacttestresult/)

Defined in: [packages/hypothesis-test/src/fisher-exact-test.ts:40](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/hypothesis-test/src/fisher-exact-test.ts#L40)

Test conditional independence in a 2×2 table with fixed margins. One-sided tails include the observed top-left count, and a zero margin gives a p-value of one. The two-sided test sums all tables whose mass is at most the observed table’s mass, with a relative allowance of 1e-7. Time is linear in the number of tables with the margins supplied. The calculation uses constant working storage.

## Parameters

### table

[`FisherExactTestTable`](/reference/knotkit/hypothesis-test/type-aliases/fisherexacttesttable/)

### options?

[`FisherExactTestOptions`](/reference/knotkit/hypothesis-test/interfaces/fisherexacttestoptions/)

## Returns

[`FisherExactTestResult`](/reference/knotkit/hypothesis-test/interfaces/fisherexacttestresult/)

## Throws

With `INVALID_TABLE`, `INVALID_COUNT`, or `INVALID_OPTION`.

## Throws

With `INVALID_PARAMETER` outside the supported hypergeometric parameter domain.
