# NOT RUN {
# small distance matrix, Mantel test run deterministically
mantel.test(dist(1:7), dist(1:7))
# }
# NOT RUN {
# run test on smallest distance matrix which requires a random
# permutation test, and plot it
plot(mantel.test(dist(1:8), dist(1:8), method="kendall"))
# }
# NOT RUN {
# }
# NOT RUN {
# 2x2x2x2 design
mantel.test(hammingdists(enumerate.meaningcombinations(c(2, 2, 2, 2))),
dist(1:16), plot=TRUE)
# }
# NOT RUN {
# using the formula interface in combination with a data frame:
print(data <- cbind(word=c("aa", "ab", "ba", "bb"),
enumerate.meaningcombinations(c(2, 2))))
mantel.test(word ~ Var1 + Var2, data)
# }
# NOT RUN {
# pass a list of distance matrices as the first argument, but just one
# distance matrix as the second argument: this runs separate tests on
# the pairwise combinations of the first and second argument
result <- mantel.test(list(dist(1:8), dist(sample(8:1)), dist(runif(8))),
hammingdists(enumerate.meaningcombinations(c(2, 2, 2))))
# print the result of the three independently run permutation tests
print(result)
# show the three test results in one plot
plot(result, xlab="group")
# }
Run the code above in your browser using DataLab