Raj, Towfique
2006-Sep-11 13:14 UTC
[R] Wilcoxon Rank-Sum Test with Bonferroni's correction
Dear all, I am trying to run Wilcoxon Rank-Sum Test with Bonferroni's correction. I have two lists: l0, l1: mapply(function(x,y)wilcox.test(x,y)$p.value, l0, l1) How do I run Bonferroni's correction on mapply? Any help is much apperciated. Thanks, -Raj
David Barron
2006-Sep-11 20:21 UTC
[R] Wilcoxon Rank-Sum Test with Bonferroni's correction
How about something like: wilcox.bonf <- function(a,b) { n <- length(a) mapply( function(x,y) wilcox.test(x,y)$p.value*n,a,b) } On 11/09/06, Raj, Towfique <trajnp at gmail.com> wrote:> Dear all, > > I am trying to run Wilcoxon Rank-Sum Test with Bonferroni's > correction. I have two lists: l0, l1: > > mapply(function(x,y)wilcox.test(x,y)$p.value, l0, l1) > > How do I run Bonferroni's correction on mapply? Any help is much apperciated. > Thanks, > > -Raj > > ______________________________________________ > R-help at stat.math.ethz.ch 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. >-- ================================David Barron Said Business School University of Oxford Park End Street Oxford OX1 1HP
Spencer Graves
2006-Sep-20 07:21 UTC
[R] Wilcoxon Rank-Sum Test with Bonferroni's correction
Consider the following: l0 <- list(1:3, 4:5) l1 <- list(6:8, 9:11, 12:16) WT <- mapply(function(x,y)wilcox.test(x,y)$p.value, l0, l1) The simplest Bonferroni for this case would be as follows: length(WT)*WT Greater numerical precision could be obtained as follows: 1-(1-WT)^length(WT) If you aren't satisfied with either of these, I suggest two things: First have you tried help('Bonferroni')? This produced 124 hits for me just now. Second, please expand your example slightly to make it self contained (as I tried to do above) and PLEASE do read the posting guide "www.R-project.org/posting-guide.html". Hope this helps. Spencer Graves Raj, Towfique wrote:> Dear all, > > I am trying to run Wilcoxon Rank-Sum Test with Bonferroni's > correction. I have two lists: l0, l1: > > mapply(function(x,y)wilcox.test(x,y)$p.value, l0, l1) > > How do I run Bonferroni's correction on mapply? Any help is much apperciated. > Thanks, > > -Raj > > ______________________________________________ > R-help at stat.math.ethz.ch 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. >