ChiQuadratTest
ChiQuadratTest, commonly referred to as the chi-squared test, is a statistical hypothesis test used for categorical data to assess how well observed frequencies match expected frequencies under a null hypothesis. It is employed in two main settings: goodness-of-fit tests, where a single categorical distribution is compared to a specified model, and tests of independence, where the relationship between two categorical variables is evaluated in a contingency table.
The test statistic is X^2 = sum over all categories of (O_i − E_i)^2 / E_i, where O_i are
Key assumptions include independent observations, mutually exclusive categories, and adequately large expected counts (commonly E_i ≥ 5).