All problems
Variance of ATE Estimator
Problem
Return the variance of the difference-in-means ATE estimator, var_x/n_x + var_y/n_y, using unbiased sample variances. Return 0.0 when either sample has fewer than two values.
Hint
Add the two squared standard errors.
Test cases
case 1
in: [[1,2,3,4,5],[2,4,6,8,10]]
expected: 2.5
case 2
in: [[1,2],[3,4]]
expected: 0.5
case 3
in: [[1],[2,3]]
expected: 0
case 4
in: [[2,2],[2,2]]
expected: 0
case 5
in: [[1,2,3],[10,20,30]]
expected: 33.66666666666667
Starter codePython
def ate_variance(x, y):
# Your code here
pass5 test cases · run your code against them in the editor