Rcode for Chapter 13.1 in Lecture Notes Written by Kyle Krumsick > rand <- c(replicate(1000, data.frame(Anova(lm(sample(SRB$VO2,48,TRUE)~ + factor(SRB$Xsp)*factor(SRB$Xsal)),type="III"))[4,3])) > length(rand[rand>(Anova(GLM.1, type="III"))[4,3]])/100 #Interaction term > rand <- c(replicate(1000, data.frame(Anova(lm(sample(SRB$VO2,48,TRUE)~ + factor(SRB$Xsp)*factor(SRB$Xsal)),type="III"))[3,3])) > length(rand[rand>(Anova(GLM.1, type="III"))[3,3]])/100 #Salinity effect > rand <- c(replicate(1000, data.frame(Anova(lm(sample(SRB$VO2,48,TRUE)~ + factor(SRB$Xsp)*factor(SRB$Xsal)),type="III"))[2,3])) > length(rand[rand>(Anova(GLM.1, type="III"))[2,3]])/100 # Species effect