Hi everyone, I've been asked to run a number of Wilcoxon tests on some behavioral data (below is a sample). They want me to compare each trial to the first trial, considered the control trial. I know I can use brackets to index and select, for example, trial 1 vs. trial 4 (not exactly sure how to set that up either) but it would save me a ton of time if there was a way to do all the comparisons at once - but for one response variable (e.g., removed) at a time.
Thanks so much! Jeff structure(list(id = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L), trial = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L), sex = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), removed = c(2.65, 1.41, 2.24, 0, 2.65, 3.87, 2.24, 2.65, 4.36, 2.24, 2.45, 2.45, 2.45, 2.24, 2.45, 2.65, 5.48, 2.65, 2.83, 1.73, 2.45, 2.24, 2.45, 3.46, 1.41, 1.73, 2.45, 1, 2.83, 1.73, 2.83, 3, 3.74, 2.24, 2.24, 1.41, 2.83, 2.45, 3.16, 3.61, 3.61, 3.16, 2.65, 2.65, 3.74, 2, 5.39, 5.48, 4.69, 3.46, 2.45, 5.39, 3.74, 1.73, 3.74, 3.32, 4.24, 0, 3, 1, 3, 2, 3.16, 3.46, 3.16, 1, 2.83, 1.41, 5.48, 2.45, 3.46, 2.45, 3.16, 1, 2.65, 3, 1.73, 3.61, 4.12, 2.24), eaten = c(2, 1, 1, 0, 2.24, 1, 0, 1.41, 2.45, 2, 1.73, 2, 2, 1, 1, 1.73, 2.83, 2, 2.45, 1.41, 2.45, 1, 1.41, 2.65, 1, 1.73, 2.24, 1, 1.73, 1.73, 2.24, 1.73, 2.83, 2, 1.73, 1, 2.24, 1, 2, 2, 2.45, 2.24, 2.45, 1.73, 2.24, 1.41, 1.73, 2.45, 2, 2, 2.24, 1.73, 2.45, 1.73, 1, 2.45, 2, 0, 1.73, 1, 2.24, 1.41, 2, 2.45, 1.73, 1, 2, 1.41, 1.73, 1.41, 2.24, 2.24, 1.41, 1, 2, 1, 1.73, 1.41, 2, 2.24), scatter = c(1.41, 0, 1.73, 0, 0, 2.83, 0, 2.24, 3, 1, 1.41, 0, 1.41, 1.41, 1.41, 2, 0, 1.73, 1, 0, 0, 1.73, 0, 2.24, 0, 0, 0, 0, 1.41, 0, 0, 2.45, 2, 1, 1.41, 1, 1.73, 2, 1, 2.45, 1, 1.73, 1, 1.41, 1.41, 1.41, 1.41, 3.61, 1, 2.83, 1, 0, 1, 0, 1, 2.24, 1.73, 0, 2.45, 0, 0, 1.41, 0, 2.45, 0, 0, 2, 0, 0, 1.73, 0, 1, 1, 0, 1, 1.41, 0, 2.45, 1, 0), larder = c(1, 1, 1, 0, 1.41, 2.45, 2.24, 0, 2, 0, 1, 1.41, 0, 1.41, 1.73, 0, 4.69, 0, 1, 1, 0, 1, 2, 0, 1, 0, 1, 0, 1.73, 0, 1.73, 0, 1.41, 0, 0, 0, 0, 1, 2.24, 1.73, 2.45, 1.41, 0, 1.41, 2.65, 0, 4.9, 3.32, 4.12, 0, 0, 5.1, 2.65, 0, 3.46, 0, 3.32, 0, 0, 0, 2, 0, 2.45, 0, 2.65, 0, 0, 0, 5.2, 1, 2.65, 0, 2.65, 0, 1.41, 2.45, 0, 2.24, 3.46, 0), total = c(1.73, 1, 2, 0, 1.41, 3.74, 2.24, 2.24, 3.61, 1, 1.73, 1.41, 1.41, 2, 2.24, 2, 4.69, 1.73, 1.41, 1, 0, 2, 2, 2.24, 1, 0, 1, 0, 2.24, 0, 1.73, 2.45, 2.45, 1, 1.41, 1, 1.73, 2.24, 2.45, 3, 2.65, 2.24, 1, 2, 3, 1.41, 5.1, 4.9, 4.24, 2.83, 1, 5.1, 2.83, 0, 3.61, 2.24, 3.74, 0, 2.45, 0, 2, 1.41, 2.45, 2.45, 2.65, 0, 2, 0, 5.2, 2, 2.65, 1, 2.83, 0, 1.73, 2.83, 0, 3.32, 3.61, 0)), .Names = c("id", "trial", "sex", "removed", "eaten", "scatter", "larder", "total"), class = "data.frame", row.names = c(NA, -80L)) (Obrigado Rui!) [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.