Definition
Chi-square test
A test of association between categorical variables, comparing observed counts in a contingency table with the counts expected under independence.
The chi-square test of independence asks: do the proportions differ across groups (did more of condition A pass than condition B)? It compares each cell’s observed count with what independence would predict; big total deviation means association.
It needs adequate expected counts (the rule of thumb: at least 5 per cell) — otherwise use Fisher’s exact test. Paired categorical data (same people before/after) require McNemar’s test instead, a distinction reviewers check.