Part 6: Beyond Two Groups
The real world rarely comes in pairs.
Up to this point, most of our inference work has involved one group or two: one sample versus a claimed value, or one group compared to another. That covers a lot of situations, but life is usually more complicated. A pharmaceutical company doesn't test just one dose against a placebo — it tests three doses and a placebo. A school district doesn't compare just two teaching methods — it compares five. A sociologist studying income doesn't split people into just two education levels — there are multiple categories that matter.
When you have more than two groups to compare, you need new tools. And that's exactly what this part of the book delivers.
Chapter 19 introduces chi-square tests — your go-to method for analyzing categorical data. Does the distribution of customer preferences match what marketing predicted? Is there a relationship between gender and career choice? Is the racial composition of a jury pool consistent with the community it's drawn from? Chi-square tests handle these questions by comparing what you observed to what you'd expect if nothing interesting were going on. You'll learn both the goodness-of-fit test (does my data match a theoretical distribution?) and the test of independence (are two categorical variables related?).
Chapter 20 is the big one: Analysis of Variance, or ANOVA. If you've ever wondered "is there a statistically significant difference among these group means?" — that's ANOVA's job. The key insight is elegant: ANOVA works by decomposing the total variation in your data into "between-group" variation and "within-group" variation. If the between-group variation is large relative to the within-group variation, something real is going on. You'll also learn about post-hoc tests, because if ANOVA tells you "at least one group is different," you'll want to know which one.
Chapter 21 gives you a safety net. What happens when your data violates the assumptions that t-tests and ANOVA require — when it's heavily skewed, has extreme outliers, or just doesn't look normal? That's where nonparametric methods come in. These techniques (the Wilcoxon rank-sum test, the Wilcoxon signed-rank test, the Kruskal-Wallis test) make fewer assumptions about your data's distribution, trading a little bit of power for a lot of flexibility. They're essential tools for messy, real-world data.
By the end of Part 6, you'll be able to handle comparisons involving any number of groups, any type of variable, and any level of messiness. That sets you up for Part 7, where we move from comparing groups to modeling relationships.