When Not To Pool
Two groups of developers took the same coding test after training on different stacks.
| Group | n | mean score | sd |
|---|---|---|---|
| JavaScript | 12 | 74.0 | 22.0 |
| Kotlin | 60 | 71.0 | 6.0 |
The sample variances differ by a factor of 13, so you use Welch's test rather than the pooled one. A teammate writes the degrees-of-freedom helper:
def welch_df(s1, n1, s2, n2):
a = s1**2 / n1
b = s2**2 / n2
return (a + b)**2 / (a**2 / n1 + b**2 / n2)
print(round(welch_df(22.0, 12, 6.0, 60), 2)) # 12.36
The denominator is wrong. Report the correct Welch-Satterthwaite degrees of freedom for this data.
Answer format: round to 2 decimal places.
Sign in to answer questions and track your progress
Sign In