Effect Size: Cohen's d

easy
Checkpoint challenge
Solve this to show you know the material and jump straight to Unit 2. Everything before it counts as cleared.

With enough users, even a tiny difference is "statistically significant". Effect size tells you whether it's big enough to matter. Cohen's d is the difference in means measured in pooled standard deviations:

d=aˉ−bˉsp,sp=(na−1)sa2+(nb−1)sb2na+nb−2d = \frac{\bar a - \bar b}{s_p}, \qquad s_p = \sqrt{\frac{(n_a - 1)s_a^2 + (n_b - 1)s_b^2}{n_a + n_b - 2}}

with sample variances (ddof=1). Implement cohens_d(a, b) and describe_effect(d), which returns "negligible" for ∣d∣<0.2|d| < 0.2, "small" for <0.5< 0.5, "medium" for <0.8< 0.8 and "large" otherwise. Raise ValueError if either group has fewer than 2 values or the pooled standard deviation is 0.

#statistics#experimentation2 visible + 2 hidden tests
solution.py · Python 3.13
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Effect Size: Cohen's d · TechGradify