#generate some data
factor1 = c(rep(1, 9), rep(2, 9), rep(3,9))
factor2 = c(rep(1,9), rep(2,9), rep(3,9))
temp = expand.grid(c(1,2,3), c(1,2,3))
temp = as.data.frame(rbind(temp, temp, temp))
temp = cbind(temp, rnorm(27, 20, 2))
names(temp) = c("factor1", "factor2", "response")
#have a look at the design matrix
temp
mvPlot(y = temp[,3], factor1 = temp[,1], factor2 = temp[,2], col.b = "red3", horiz = FALSE)
Run the code above in your browser using DataLab