Block 95: ANOVA & Chi-Square Tests
Compare multiple groups and test categorical relationships.
Concepts
- scipy.stats.f_oneway() for one-way ANOVA
- When to use ANOVA vs t-test
- scipy.stats.chi2_contingency() for independence
- Reading a contingency table
Code Examples
See exercise below.
Exercise
Test if Iris petal_length differs significantly across all 3 species using ANOVA. Chi-square test: is passenger class independent of survival in Titanic?
Homework
When is ANOVA more appropriate than running multiple t-tests? What is the multiple comparisons problem?