Skip to content
DeepForgeby svx
All problems
EasyStatisticsst-276

ATE from a Table

Problem

Return the average treatment effect implied by group summary totals, treated_sum/treated_n minus control_sum/control_n. Return 0.0 when either group size is not positive.

Hint

Compare the two group means directly.

Test cases

case 1
in: [50,250,40,280]
expected: 2
case 2
in: [10,100,10,100]
expected: 0
case 3
in: [0,0,5,20]
expected: 0
case 4
in: [4,6,2,5]
expected: 1
case 5
in: [3,0,3,9]
expected: 3
Starter codePython
def ate_from_table(control_n, control_sum, treated_n, treated_sum):
    # Your code here
    pass

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