Chi-Squared TestΒΆ

Chi-Squared Test algorithm is used to analyze a correlation relationship between two attributes. The \(\chi^2\)-value for attributes \(A\) and \(B\) is computed as:

\[\chi^2 = \sum_{i=1}^{N} \sum_{j=1}^{M} \frac{(o_{ij} - e_{ij})^2}{e_{ij}} \, \text{,}\]

where \(o_{ij}\) is the observed frequency of the joint event of pair \((A_i, B_j)\) and \(e_{ij}\) is the corresponding expected frequency.

Input Parameters

Parameter Type Constraint Description Remarks
\(A\) \(A = \{a_i\}, i = 1, 2, \ldots, N\) \(N \in \mathbb{N}\) None None
\(B\) \(B = \{b_i\}, i = 1, 2, \ldots, M\) \(M \in \mathbb{N}\) None None
\((e_{ij})\) \((e_{ij}) \in \mathbb N^{N \times M}\) None None None

Output Parameters

Parameter Type Constraint Description Remarks
\(\chi^2\) \(\chi^2 \in \mathbb R\) None None None

Single Steps using the Algorithm

References

  • P.E. Greenwood, M.S. Nikulin, A guide to chi-squared testing, Wiley, New York, 1996.