# NOT RUN {
# Simulated data (completely randomized design)
rv <- c(100.08, 105.66, 97.64, 100.11, 102.60, 121.29, 100.80,
99.11, 104.43, 122.18, 119.49, 124.37, 123.19, 134.16,
125.67, 128.88, 148.07, 134.27, 151.53, 127.31)
# Treatments
treat <- factor(rep(LETTERS[1:5], each = 4))
# Anova
res <- aov(rv~treat)
# Loading the MCPtests package
library(MCPtests)
# Choosing tests
results <- MCPtest(y = res, trt = "treat", alpha = 0.05,
main = "Multiple Comparison Procedures",
MCP = c("MGM", "TM"))
MCPbarplot(results, MCP = "all") # It will be shown two
# graphs. First, for the
# results of \code{'MGM'}
# and the second for the
# results of \code{'TM'}.
MCPbarplot(results, MCP = "MGM") # It will be shown
# only the graph
# for the result of
# \code{'MGM'}
# Plot for papers
MCPbarplot(results, MCP = "all", col = gray.colors(10))
# }
Run the code above in your browser using DataLab