pdf("C:\\Rmisc\\graphs\\amoeba.pdf") amoeba1 <- read.fwf("C:\\data\\amoeba.txt", width=c(8,8), col.names=c("Trt", "Yield")) fTrt <- factor(amoeba1$Trt, levels=1:5) levels(fTrt) <- c("None", "H", "F", "HF", "FH") amoeba <- data.frame(amoeba1, fTrt) attach(amoeba) kruskal.test(Yield~fTrt) amoeba1.aov <- aov(Yield~fTrt) summary(amoeba1.aov) # Obtain Tukey's Comparisons among levels of treatment TukeyHSD(amoeba1.aov, "fTrt") # Obtain Bonferroni's Comparisons among levels of treatment (does not use MSE from ANOVA and not pooled df) pairwise.t.test(Yield, fTrt, p.adj="bonf") # Histogram of Residuals and Plot Residuals versus Time order hist(residuals(amoeba1.aov), breaks=seq(-75,75,15)) plot(residuals(amoeba1.aov), type="o") # Bartlett's test for equal variances bartlett.test(Yield~fTrt) dev.off()