Within the context of a 2-way ANOVA, I would like to enter contrast levels for one factor (10, 20, 30 degrees) within levels of another factor (SpeciesA, SpeciesB). This assumes the interaction effect is significant so the contrasts cannot simply be done on the temperature main effect.
I have attempted to do this within EZanova, multcomp and phia, but have been unable to figure out a syntax that works. Have I missed a package that allows this?
Contrast and coefficients
Contrast1: Does 10 degrees differ from 20 and 30 for Species A? Species:Temp (2,-1,-1,0,0,0) Contrast2: Does 10 degrees differ from 20 and 30 for Species B? Species:Temp (0,0,0,2,-1,-1) Contrast3: Does 10 degrees for Species A differ from 20 and 30 degrees for Species B? Species:Temp (2,0,0,0,-1,-1)
species<-rep(c("speciesA","speciesB"),each=12)
temp<-rep(rep(c("10","20","30"),each=4),2)
y<-rnorm(24,5,3)
(result<-anova(lm(y~species*temp)))