This section introduced the chi-squared test in three related settings: comparing proportions across populations/treatments, comparing full categorical distributions across populations/treatments, and testing association between two categorical variables in one random sample.
Across all settings, the mechanics are the same: compare observed cell counts to expected counts under the null model and summarize discrepancies with the chi-squared statistic.
When the test is significant, examining individual cell contributions helps describe the nature of the association. The data collection method still determines what conclusions are justified about causation and generalizability.