Click or drag to resize

ContingencyTableR, CPearsonChiSquaredTest Method

Performs a Pearson χ2 test for correlation in the table.

Namespace:  Meta.Numerics.Statistics
Assembly:  Meta.Numerics (in Meta.Numerics.dll) Version: 4.1.4
Syntax
public virtual TestResult PearsonChiSquaredTest()

Return Value

Type: TestResult
The result of the test. The test statistic is χ2 and its likelihood under the null hypothesis is the (right) probability to obtain a value as large or larger.
Remarks

The Pearson Pearson χ2 test tests for correlation between the row and column values. If row and column values are uncorrelated, then the expected number of counts in a table entry is simply proportional to the totals for its row and column. If that number is large for all entries, then the central limit theorem suggests that the actual number of counts will be distributed normally with mean equal to the expected value and standard deviation equal to its square root. The χ2 statistic measures the departure of the actual table from this expectation in the uncorrelated case, and under this null hypothesis its distribution is known. Having calculated χ2, then, we can compute just how unlikely it was to obtain a value as large or larger than the one obtained.

In cases where either the actual or expected counts for some entries are small or zero, the assumptions of the Pearson χ2 test are violated and it should not be used. For 2 X 2 experiments, the FisherExactTest is a viable alternative in these cases.

See Also