pdf("C:\\Rmisc\\graphs\\kuehl_06_02.pdf") aggtype <- c(rep(1:2,each=12)) compmeth <- c(rep(1:4,each=3,times=2)) strength <- c(68,63,65,126,128,133,93,101,98,56,59,57, 71,66,66,107,110,116,63,60,59,40,41,44) concrete <- data.frame(aggtype,compmeth,strength) attach(concrete) aggtype <- factor(aggtype,levels=1:2,labels=c("B","S")) compmeth <- factor(compmeth,levels=1:4,labels=c("S","R","L","V")) tapply(strength,list(aggtype,compmeth),mean) tapply(strength,list(aggtype,compmeth),sd) concrete.mod1 <- aov(strength ~ aggtype*compmeth) anova(concrete.mod1) summary.lm(concrete.mod1) library(gmodels) concrete.mod2 <- lm(strength ~ aggtype:compmeth + 0) summary(concrete.mod2) contrasts.mod2 <- rbind( 'B vs S in Static ' = c(1,-1,0,0,0,0,0,0), 'B vs S in Regular ' = c(0,0,1,-1,0,0,0,0), 'B vs S in Low ' = c(0,0,0,0,1,-1,0,0), 'B vs S in Very Low ' = c(0,0,0,0,0,0,1,-1)) estimable(concrete.mod2,contrasts.mod2) dev.off()