data <- matrix(scan(),ncol=10,byrow=TRUE) -1 -1 -1 -1 -1 -1 1 -1 1 40.2 1 -1 -1 -1 1 1 -1 -1 -1 43.7 -1 1 -1 -1 -1 -1 1 1 -1 44.7 1 1 -1 -1 1 1 -1 1 1 42.4 -1 -1 1 -1 1 -1 -1 1 -1 45.9 1 -1 1 -1 -1 1 1 1 1 42.4 -1 1 1 -1 1 -1 -1 -1 1 40.6 1 1 1 -1 -1 1 1 -1 -1 42.2 -1 -1 -1 1 -1 1 -1 1 -1 45.5 1 -1 -1 1 1 -1 1 1 1 42.4 -1 1 -1 1 -1 1 -1 -1 1 40.6 1 1 -1 1 1 -1 1 -1 -1 43.6 -1 -1 1 1 1 1 1 -1 1 40.2 1 -1 1 1 -1 -1 -1 -1 -1 44.0 -1 1 1 1 1 1 1 1 -1 46.5 1 1 1 1 -1 -1 -1 1 1 42.5 data oex18.3 <- data.frame(data) colnames(oex18.3) <- c("a","b","c","d","e","f","g","h","j","y") rm(data) # using the within function to convert variables to factor oex18.3 <- within(oex18.3, { a <- factor(a) b <- factor(b) c <- factor(c) d <- factor(d) e <- factor(e) f <- factor(f) g <- factor(g) h <- factor(h) j <- factor(j) } ) oex18.3.aov <- aov(lm(y ~ a*b*c*d, data = oex18.3)) library(gplots) qqnorm(oex18.3.aov) # with this command, you can click on and label points # to get out of this mode, you can select the "R Console" window and hit the Escape button if (dev.interactive()) qqnorm(oex18.3.aov, label=TRUE) # now fitting the model with only "active-appearing" effects oex18.3.lm2 <- lm(y ~ h +j +h:j, data = oex18.3) anova(oex18.3.lm2) par(mfrow=c(2,2)) plot(oex18.3.lm2) par(mfrow=c(1,1)) # many other packages have features for FF designs, FrF2 is one of them library(FrF2) FrF2(nruns=4,nfactors=3,factor.names=list(Mayo=c("Regular","Spicy"),Patty=c("Veggie","Beef"), Cheese=c("Absent","Present")),randomize=TRUE)