All problems
ANOVA Within-Group Sum of Squares
Problem
Return the within-group sum of squares sum over groups of sum((x - group_mean)^2) for a list of groups. Return 0.0 when there are no values.
Hint
Sum the squared deviations from each group's own mean.
Test cases
case 1
in: [[[1,2,3],[4,5,6],[7,8,9]]]
expected: 6
case 2
in: [[[5,5],[5,5]]]
expected: 0
case 3
in: [[[1],[2],[3]]]
expected: 0
case 4
in: [[[10,20],[30,40]]]
expected: 100
case 5
in: [[]]
expected: 0
Starter codePython
def anova_within_ss(groups):
# Your code here
pass5 test cases · run your code against them in the editor