One-Way ANOVA F-Statistic

medium
Unit 17 · Hypothesis Testing II0/3 to milestone

ANOVA tests whether several group means are equal by comparing between-group and within-group variation:

F=SSB/(k−1)SSW/(N−k),SSB=∑gng(xˉg−xˉ)2,SSW=∑g∑i(xgi−xˉg)2F = \frac{SS_B/(k-1)}{SS_W/(N-k)},\quad SS_B = \sum_g n_g(\bar x_g - \bar x)^2,\quad SS_W = \sum_g\sum_i (x_{gi} - \bar x_g)^2

Implement anova(*groups) returning a dict with F, df_between, df_within, ss_between, ss_within and eta_squared (SSB/(SSB+SSW)SS_B / (SS_B + SS_W)).

#hypothesis-testing#anova2 visible + 1 hidden tests
solution.py · Python 3.13
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
One-Way ANOVA F-Statistic · TechGradify