ANOVA3 demo

from doenova import anovan
 
#     A    B  C
X = [[20, -1, 0],
     [20, -1, 5],
     [40, -1, 0],
     [40, -1, 5],
     [60, -1, 0],
     [60, -1, 5],
     [20,  1, 0],
     [20,  1, 5],
     [40,  1, 0],
     [40,  1, 5],
     [60,  1, 0],
     [60,  1, 5]]
 
y = [5.6, 3.4, 7.6, 2.3, 6.4, 7.1,
     3.4, 1.2, 1.5, 9.8, 5.7, 3.4]
# The first result in y is associated to the first row in X,
# The second result in y is associated to the second row in X,
# and so on...
 
#       A  B  C
sel = [[1, 0, 0], # A
       [0, 1, 1], # BC
       [1, 1, 1]] # ABC
 
anova_comps = anovan(y,X,sel)
# If sel is not provided as a third argument,
# the ANOVA considers all single factors in the case
# where X does not contain replicates.