Skip to content
DeepForgeby svx
All problems
EasyStatisticsst-098

Design Effect (Kish)

Problem

Return Kish's design effect 1 + (m - 1)*icc for clusters of size m. Return 0.0 when m <= 0.

Hint

The design effect inflates the variance of a cluster sample relative to simple random sampling.

Test cases

case 1
in: [10,0.05]
expected: 1.45
case 2
in: [1,0.5]
expected: 1
case 3
in: [20,0]
expected: 1
case 4
in: [0,0.1]
expected: 0
case 5
in: [5,0.2]
expected: 1.8
Starter codePython
def design_effect(cluster_size, icc):
    # Your code here
    pass

5 test cases · run your code against them in the editor