data <- scan(what = list(session=0,treat="",plates=0), multi.line=F) 1 b1-3 19 1 b1-2 17 1 b1-1 11 2 b1-0 6 2 b2-3 26 2 b2-2 23 3 b2-1 21 3 b2-0 19 3 ctrl 28 4 b1-3 20 4 b1-0 7 4 b2-1 20 5 b1-2 17 5 b2-3 26 5 b2-0 19 6 b1-1 15 6 b2-2 23 6 ctrl 31 7 b1-3 20 7 b2-3 26 7 ctrl 31 8 b1-2 16 8 b2-2 23 8 b2-1 21 9 b1-1 13 9 b1-0 7 9 b2-0 20 10 b1-3 20 10 b2-2 24 10 b2-0 19 11 b1-2 17 11 b1-0 6 11 ctrl 29 12 b1-1 14 12 b2-3 24 12 b2-1 21 data oemp14.2 <- data.frame(data) rm(data) oemp14.2$session <- as.factor(oemp14.2$session) oemp14.2$treat <- as.factor(oemp14.2$treat) # intrablock analysis oemp14.2.lm <- lm(plates ~ session + treat, data = oemp14.2) anova(oemp14.2.lm) # check assumptions par(mfrow=c(2,2)) plot(oemp14.2.lm) par(mfrow=c(1,1)) # using the afex package to recover interblock information ; library(afex) oemp14.2.afex1 <- mixed(plates ~ (1|session) + treat, data = oemp14.2) summary(oemp14.2.afex1) nice(oemp14.2.afex1) lsmeans(oemp14.2.afex1, ~treat) # testing the contrast shown in the text levels(oemp14.2$treat) oemp14.2.afex1.lsm <- lsmeans(oemp14.2.afex1, "treat") oemp14.2.afex1.lsm Contrasts = list(Base1vsBase2 = c(.25, .25, .25, .25, -.25, -.25, -.25, -.25, 0)) contrast(oemp14.2.afex1.lsm, Contrasts, adjust = "none")