categorical
Chi-square test
Test association between two categorical variables.
Requirements
- two categorical variables
- adequate expected cell counts
Avoid when
- small 2x2 counts
- paired binary data
Formula
χ² = Σ (O−E)²/E
Interpretation
Tests whether row and column proportions are independent.
Worked example
Test whether smoking category and diagnosis category are associated.
Open example datasets