28/36
Part 5 of 6 · The worked exampleLearn and do
Power: count cities, not users
Power runs the same math backwards:
In words: is the users per arm you'd need if users were independent. Times the design effect, it's the users you need. Divided by , the users per city, it's the cities you need in each arm.
Say you want to detect a lift of 0.1 standard deviations, at 5% two-sided, with 80% power. With independent users that's , about 1,570 per arm. Here 1.96 is the two-sided 5% cutoff, and 0.84 the point with 80% of the normal curve below it. The sample-size lesson derives this.
With 50 users per city and , the design effect is 3.45. So it takes 5,416 users, 109 cities per arm.
In the editor, write cities_per_arm(effect_sd, m, icc): the cities per arm for a given city size and ICC.