With equal city sizes, the design effect is 1 + (m - 1) × ICC
The ICC turns into a factor on the variance.
Equal cities of 50 users and an ICC of 0.36. The design effect is 1 + (m - 1) × ICC. About how big?
Take one arm's mean. With m users in each city and GT treated cities, it's the average of GT city means. Each city mean has variance σb2+σw2/m: the shock, plus the user noise shrunk by averaging, as the city_mean_variance task found. So:
The second line rearranges the first. Its first factor is the variance that NT=GTm independent users would give. The second factor is the design effect, DEFF: how many times bigger the true variance is.
DEFF=1+(m−1)ρNeff=DEFFNIn words: m−1 counts the other users who share each user's city. Neff, the effective sample size, is how many independent users your N users are worth.
Treat the users as independent and you understate the variance by a factor of about DEFF, and the standard error by about DEFF.
The formula holds exactly under these conditions:
- every city has the same number of users, m
- the treatment is the same for every user in a city, as it is when you randomize cities
- different cities' shocks are independent, and so is each user's own noise
- both arms have the same ICC.
The practice data meets all four, with ρ=0.36 and m=50. So DEFF=1+49×0.36=18.64. That predicts a clustered standard error 18.64=4.3 times the naive one, and 2,000 users worth about 107 independent ones.
The data shows 4.1 times, 0.446 against 0.108. The formula gives the expected ratio. A clustered standard error from 40 cities is itself an estimate: the true standard deviation of this design's estimate is 0.48, and this data set's clustered estimate lands a little low.
In the editor, write design_effect(city_sd, user_sd, m): the ICC from the two spreads, then the design effect.
- 1
Write
design_effect(city_sd, user_sd, m): the ICC from the standard deviation of the city shocks and of each user's own noise, then 1+(m−1)ρ for cities ofmusers. The practice data's standard deviations are 1.5 and 2, in cities of 50.
Run your code to check it. Output shows here.