All problems
Split-Plot Variance
Problem
Return the variance of a difference between two whole-plot treatment means in a split-plot design: 2*(var_whole + var_sub/n_sub)/r_blocks for r whole-plot blocks. Return 0.0 when n_sub or r_blocks is not positive or a variance is negative.
Hint
Whole-plot effects carry more variance than subplot effects.
Test cases
case 1
in: [4,9,3,5]
expected: 2.8
case 2
in: [1,1,1,1]
expected: 4
case 3
in: [0,4,2,4]
expected: 1
case 4
in: [2,2,4,2]
expected: 2.5
case 5
in: [1,1,1,0]
expected: 0
Starter codePython
def split_plot_variance(var_whole, var_sub, n_sub, r_blocks):
# Your code here
pass5 test cases · run your code against them in the editor