7/17
Part 3 of 7 · What a p-value saysLearn
If nothing is going on, p-values are spread evenly
What do p-values look like when the null is true? Here are 2,000 tests of two groups drawn from the same distribution:
import random
rng = random.Random(9)
ps = []
for _ in range(2_000):
x = [rng.gauss(4, 1) for _ in range(20)]
# the same distribution: no real difference
y = [rng.gauss(4, 1) for _ in range(20)]
t, df = welch(mean(x), stdev(x), 20, mean(y), stdev(y), 20)
ps.append(t_two_sided_p(t, df, steps=200))
print(f"{sum(p < 0.05 for p in ps) / len(ps):.1%} of the p-values fall below 0.05")
print("by tenths:", [sum(k / 10 <= p < (k + 1) / 10 for p in ps) for k in range(10)])
With no real difference anywhere, how many of the 2,000 tests come out below 0.05?
Pick one to see what it prints.
Pick an answer above to see the rest
A test on 2 million users finds a 0.1% lift in orders with p = 0.0001. What does the p-value tell you?
Pick an answer above to see the rest