HI,
I am trying to perform ANOVA with 2 factors:
material (3), temperature(3). The interaction is significant. I tried
something like, ( summary(avt,
split=list("temp:mat"=list("15"=1,
"70"=2, "125"=3))) is not correct).
Thanks,
av <- aov(time ~ mat*temp, data=dados)
avt <- aov(time ~ temp/mat)
summary(avt, split=list("temp:mat"=list("15"=1,
"70"=2, "125"=3)))
avm <- aov(time ~ mat/temp)
summary(amv, split=list("mat:temp"=list("1"=c(1,4),
"2"=c(2,5),
"3"=c(3,6))))
data
time mat temp
1 130 1 15
2 155 1 15
3 74 1 15
4 180 1 15
5 150 2 15
6 188 2 15
7 159 2 15
8 126 2 15
9 138 3 15
10 110 3 15
11 168 3 15
12 160 3 15
13 34 1 70
14 40 1 70
15 80 1 70
16 75 1 70
17 136 2 70
18 122 2 70
19 106 2 70
20 115 2 70
21 174 3 70
22 120 3 70
23 150 3 70
24 139 3 70
25 20 1 125
26 70 1 125
27 82 1 125
28 58 1 125
29 25 2 125
30 70 2 125
31 58 2 125
32 45 2 125
33 96 3 125
34 104 3 125
35 82 3 125
36 60 3 125
I continue with your example
dados$mat <- factor(dados$mat)
dados$temp <- factor(dados$temp)
contrasts(dados$temp)
contrasts(dados$temp) <- contr.poly(3)
amt <- aov(time ~ mat*temp, data=dados)
summary(amt)
summary.lm(amt)
summary(amt,
split=list(mat=list(mat2=1, mat3=2),
temp=list(temp.L=1, temp.Q=2)))
library(HH)
interaction2wt(time ~ mat*temp, data=dados)
###-------
In your original post, you did not force the factors to be factor().
In the usual usage of split=list(), the individual factors are specified
and the partitioning is automatically expanded to the interactions.
It is possible to use the interaction term directly in split(). See the
documentation
?summary.aov
for an example.
I included the interaction2wt plot from the HH library to illustrate
the appearance of the interaction.