Two more essential tests for relationships. ANOVA compares the means of three or more groups; chi-squared tests whether two categorical variables are related.
ANOVA
Comparing 3+ group means with many t-tests inflates false positives. ANOVA tests whether any group mean differs, in one test — by comparing variation between groups to variation within them. A significant result says "at least one differs"; follow up to find which.
from scipy import statsstats.f_oneway(group_a, group_b, group_c) # one-way ANOVAstats.chi2_contingency(contingency_table) # categorical association
Chi-squared
Key takeaways
- 01ANOVA compares 3+ group means in one test (avoiding inflated false positives from many t-tests).
- 02It compares between-group to within-group variation; a hit means "at least one differs".
- 03Chi-squared tests whether two categorical variables are related (a contingency table).
- 04t-test/ANOVA/chi-squared/regression cover most everyday statistical questions.
