I have a data frame with one grouping factor (first column) with several levels (more than two) and several data columns. I want to apply wilcox.test to the entire date frame to compare the variables of each group with the others. How can i do this?
UPDATE: I know that wilcox.test will only check the difference between two groups, and my data frame contains three. But I'm more interested in how to do this than those that need to be used. Most likely, one group will be deleted, but I have not decided yet that I want to check all the options.
Here is an example:
structure(list(group = c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), var1 = c(9.3, 9.05, 7.78, 7.11, 7.14, 8.12, 7.5, 7.84, 7.8, 7.52, 8.84, 6.98, 6.1, 6.89, 6.5, 7.5, 7.8, 5.5, 6.61, 7.65, 7.68), var2 = c(11L, 11L, 10L, 1L, 3L, 7L, 11L, 11L, 11L, 11L, 4L, 1L, 1L, 1L, 2L, 2L, 1L, 4L, 8L, 8L, 1L), var3 = c(7L, 11L, 3L, 7L, 11L, 2L, 11L, 5L, 11L, 11L, 5L, 11L, 11L, 2L, 9L, 9L, 3L, 8L, 11L, 11L, 2L), var4 = c(11L, 11L, 11L, 11L, 6L, 11L, 11L, 11L, 10L, 7L, 11L, 2L, 11L, 3L, 11L, 11L, 6L, 11L, 1L, 11L, 11L), var5 = c(11L, 1L, 2L, 2L, 11L, 11L, 1L, 10L, 2L, 11L, 1L, 3L, 11L, 11L, 8L, 8L, 11L, 11L, 11L, 2L, 9L)), .Names = c("group", "var1", "var2", "var3", "var4", "var5"), class = "data.frame", row.names = c(NA, -21L))
UPDATE
Thanks everyone for the answers!