ChiSquareTest Module

Two-Sample (Goodness-of-fit) Chi-Square Test (Upper Tail)

A chi-square test (also chi-squared or χ2 test) is any statistical hypothesis test in which the sampling distribution of the test statistic is a ChiSquareDistribution when the null hypothesis is true, or any in which this is asymptotically true, meaning that the sampling distribution (if the null hypothesis is true) can be made to approximate a chi-square distribution as closely as desired by making the sample size large enough.

The chi-square test is used whenever one would like to test whether the actual data differs from a random distribution.

References:

Functions and values

Function or value Description

compute degreesOfFreedom expected observed

Full Usage: compute degreesOfFreedom expected observed

Parameters:
    degreesOfFreedom : int
    expected : seq<float>
    observed : seq<float>

Returns: ChiSquareStatistics

Computes the Chi-Square test n data points -> degrees of freedom = n - 1

degreesOfFreedom : int
expected : seq<float>
observed : seq<float>
Returns: ChiSquareStatistics