Click or drag to resize

NMathFunctionsFishersExactTest(Int32, Int32, Int32, Int32, HypothesisType) Method

Returns the Fisher's Exact Test p-value for the specified 2 x 2 contingency table and alternative hypothesis.

Namespace: CenterSpace.NMath.Core
Assembly: NMath (in NMath.dll) Version: 7.4
Syntax
public static double FishersExactTest(
	int a,
	int b,
	int c,
	int d,
	HypothesisType type
)

Parameters

a  Int32
Upper left cell in contingency table.
b  Int32
Upper right cell in contingency table.
c  Int32
Lower left cell in contingency table.
d  Int32
Lower right cell in contingency table.
type  HypothesisType
Enum value indicating the form of the alternative hypothesis.

Return Value

Double
The p-value.
Exceptions
ExceptionCondition
InvalidArgumentExceptionThrown if any of the count values is negative.
Remarks
a, b, c and d are cell values for contingency table:
            a  b
            c  d
            
Fisher's exact test is so-called because the significance of the deviation from a null hypothesis can be calculated exactly, rather than relying on an approximation.
Fisher's exact test is a useful alternative to the chi-square test in cases where sample sizes are small. The usual rule of thumb for deciding whether the chi-squared approximation is good enough is whether the expected values in all cells of the contingency table is greater than or equal to 5.
See Also