# Single response (AnovaMix)
mixlm <- lm(y~x*r(z),
data = data.frame(y = rnorm(8),
x = factor(c(rep(1,4),rep(0,4))),
z = factor(rep(c(1,0),4))))
Anova(mixlm,type="III")
# Double response (AnovaMixMLM)
mydata <- data.frame(Y = I(as.matrix(cbind(y1=rnorm(12), y2=rnorm(12)))),
x = factor(c(rep(2,4),rep(1,4),rep(0,4))),
z = factor(rep(c(1,0),6)))
mixlm <- lm(Y~x*r(z),
data = mydata)
Anova(mixlm,type="III")
Run the code above in your browser using DataLab