All problems
Cochran C Statistic
Problem
Cochran's C tests homogeneity of variance by dividing the largest group variance by the sum of variances.
Given the list of group variances, return the C statistic.
Hint
The maximum variance is compared against the total.
Test cases
case 1
in: [[1,1,1]]
expected: 0.3333333333333333
case 2
in: [[4,1,1]]
expected: 0.6666666666666666
case 3
in: [[2,3,5]]
expected: 0.5
Starter codePython
def cochran_c_statistic(variances):
# Your code here
pass3 test cases · run your code against them in the editor