All problems
Clustered MDE Inflation
Problem
Return the clustered minimum detectable effect, mde_individual * sqrt(1 + (cluster_size - 1)*icc). Clustering inflates the MDE by the square root of the design effect. Return 0.0 for non-positive cluster size or negative icc.
Hint
Multiply the individual MDE by the square root of the design effect.
Test cases
case 1
in: [0.2,10,0.05]
expected: 0.24083189157584595
case 2
in: [0.2,1,0.5]
expected: 0.2
case 3
in: [0.5,4,0.1]
expected: 0.570087712549569
case 4
in: [0.3,0,0.1]
expected: 0
case 5
in: [0.3,5,-0.1]
expected: 0
Starter codePython
def clustered_mde(mde_individual, cluster_size, icc):
# Your code here
pass5 test cases · run your code against them in the editor