JP
2011-Apr-28 13:18 UTC
[R] Simple General Statistics and R question (with 3 line example) - get z value from pairwise.wilcox.test
Hi there, I am trying to do multiple pairwise Wilcoxon signed rank tests in a manner similar to: a <- c(runif(1000, min=1,max=50), rnorm(1000, 50), rnorm(1000, 49.9, 0.5), rgeom(1000, 0.5)) b <- c(rep("group_a", 1000), rep("group_b", 1000), rep("group_c", 1000), rep("group_d", 1000)) pairwise.wilcox.test(a, b, alternative="two.sided", p.adj="bonferroni", exact=F, paired=T) This gives me the following output: group_a group_b group_c group_b <2e-16 - - group_c <2e-16 0.25 - group_d <2e-16 <2e-16 <2e-16 (which is kind of expected since group_b and group_c have similar distributions) I have found that when doing a wilcoxon signed ranked test you should report: - The median value (and not the mean or sd, presumably because of the underlying potential non normal distribution) - The Z score (or value) - r - p value My questions are: - Are the above enough/correct values to report (some places even quote W and df) ? What else would you suggest? - How do I calculate the Z score and r for the above example? - How do I get each statistic from the pairwise.wilcox.test call? Many Thanks JP
Uwe Ligges
2011-May-02 08:16 UTC
[R] Simple General Statistics and R question (with 3 line example) - get z value from pairwise.wilcox.test
To get the statsitics, you will have to run each wilcox.test manually. the pairwise... version just extracts the p-values and adjusts them. Uwe Ligges On 28.04.2011 15:18, JP wrote:> Hi there, > > I am trying to do multiple pairwise Wilcoxon signed rank tests in a > manner similar to: > > a<- c(runif(1000, min=1,max=50), rnorm(1000, 50), rnorm(1000, 49.9, > 0.5), rgeom(1000, 0.5)) > b<- c(rep("group_a", 1000), rep("group_b", 1000), rep("group_c", > 1000), rep("group_d", 1000)) > pairwise.wilcox.test(a, b, alternative="two.sided", > p.adj="bonferroni", exact=F, paired=T) > > This gives me the following output: > > group_a group_b group_c > group_b<2e-16 - - > group_c<2e-16 0.25 - > group_d<2e-16<2e-16<2e-16 > > (which is kind of expected since group_b and group_c have similar distributions) > > I have found that when doing a wilcoxon signed ranked test you should report: > > - The median value (and not the mean or sd, presumably because of the > underlying potential non normal distribution) > - The Z score (or value) > - r > - p value > > My questions are: > > - Are the above enough/correct values to report (some places even > quote W and df) ? What else would you suggest? > - How do I calculate the Z score and r for the above example? > - How do I get each statistic from the pairwise.wilcox.test call? > > Many Thanks > JP > > ______________________________________________ > R-help at 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.
JP
2011-May-03 08:33 UTC
[R] Simple General Statistics and R question (with 3 line example) - get z value from pairwise.wilcox.test
Thanks Uwe, How do I calculate the Z score and r value - please (once I have the p values)? Many Thanks JP 2011/5/2 Uwe Ligges <ligges at statistik.tu-dortmund.de>:> To get the statsitics, you will have to run each wilcox.test ?manually. the > pairwise... version just extracts the p-values and adjusts them. > > Uwe Ligges > > > On 28.04.2011 15:18, JP wrote: >> >> Hi there, >> >> I am trying to do multiple pairwise Wilcoxon signed rank tests in a >> manner similar to: >> >> a<- c(runif(1000, min=1,max=50), rnorm(1000, 50), rnorm(1000, 49.9, >> 0.5), rgeom(1000, 0.5)) >> b<- c(rep("group_a", 1000), rep("group_b", 1000), rep("group_c", >> 1000), rep("group_d", 1000)) >> pairwise.wilcox.test(a, b, alternative="two.sided", >> p.adj="bonferroni", exact=F, paired=T) >> >> This gives me the following output: >> >> ? ? ? ? group_a group_b group_c >> group_b<2e-16 ?- ? ? ? - >> group_c<2e-16 ?0.25 ? ?- >> group_d<2e-16<2e-16<2e-16 >> >> (which is kind of expected since group_b and group_c have similar >> distributions) >> >> I have found that when doing a wilcoxon signed ranked test you should >> report: >> >> - The median value (and not the mean or sd, presumably because of the >> underlying potential non normal distribution) >> - The Z score (or value) >> - r >> - p value >> >> My questions are: >> >> - Are the above enough/correct values to report (some places even >> quote W and df) ? ?What else would you suggest? >> - How do I calculate the Z score and r for the above example? >> - How do I get each statistic from the pairwise.wilcox.test call? >> >> Many Thanks >> JP >> >> ______________________________________________ >> R-help at 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. >
peter dalgaard
2011-May-03 19:50 UTC
[R] Simple General Statistics and R question (with 3 line example) - get z value from pairwise.wilcox.test
On Apr 28, 2011, at 15:18 , JP wrote:> > > I have found that when doing a wilcoxon signed ranked test you should report: > > - The median value (and not the mean or sd, presumably because of the > underlying potential non normal distribution) > - The Z score (or value) > - r > - p value >...printed on 40g/m^2 acid free paper with a pencil of 3B softness? Seriously, with nonparametrics, the p value is the only thing of real interest, the other stuff is just attempting to check on authors doing their calculations properly. The median difference is of some interest, but it is not actually what is being tested, and in heavily tied data, it could even be zero with a highly significant p-value. The Z score can in principle be extracted from the p value (qnorm(p/2), basically) but it's obviously unstable in the extreme cases. What is r? The correlation? Pearson, not Spearman?> My questions are: > > - Are the above enough/correct values to report (some places even > quote W and df) ?df is silly, and/or blatantly wrong...> What else would you suggest? > - How do I calculate the Z score and r for the above example? > - How do I get each statistic from the pairwise.wilcox.test call? > > Many Thanks > JP > > ______________________________________________ > R-help at 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.-- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com