All problems
Partial Eta Squared
Problem
Return partial eta squared (SS_effect/df_effect) / ((SS_effect/df_effect) + (SS_error/df_error)). Return 0.0 when a degrees-of-freedom value is not positive or the denominator is zero.
Hint
It measures the effect relative to its own error term.
Test cases
case 1
in: [54,6,2,6]
expected: 0.9642857142857143
case 2
in: [10,20,1,8]
expected: 0.8
case 3
in: [0,5,1,4]
expected: 0
case 4
in: [24,0,1,4]
expected: 1
case 5
in: [5,5,2,0]
expected: 0
Starter codePython
def partial_eta_squared(ss_effect, ss_error, df_effect, df_error):
# Your code here
pass5 test cases · run your code against them in the editor