Iurie Malai
2010-Aug-17 06:48 UTC
[R] Wilcoxon test and grouping factor with multiple levels
Dear R users, I have a dataset with two variables: $esan - a grouping factor with 8 levels and $reus. I'd like to do wilcox.test on this dataset as sugested Weiwei here: https://stat.ethz.ch/pipermail/r-help/2007-July/136627.html. I tried to adapt his recommendation but no succes. Can anyone help me? Regards, Iurie Malai, Senior Lecturer Department of Psychology Faculty of Psychology and Special Education Ion Creanga Moldova Pedagogical State University -------------- next part -------------- "esan" "reus" 1 9.3 1 9.05 1 7.78 1 7.11 1 7.14 1 8.12 1 7.5 1 7.84 1 7.8 1 7.52 1 8.84 1 6.98 1 6.1 1 6.89 1 6.5 1 7.5 1 7.8 1 5.5 1 6.61 1 7.65 1 7.68 1 7.65 1 8.37 1 5.38 1 7.89 1 7.59 1 6.31 1 7.79 1 6.01 1 7.41 1 7.56 1 6.9 1 8.2 1 7.58 1 5.99 1 6.4 1 7.52 1 8.35 1 6.91 1 7.29 1 9.43 1 7.01 1 5.96 1 6.97 1 7.31 1 5.81 1 6.3 1 7.07 1 6.4 1 7.73 1 8.79 1 9.6 1 6.87 1 7.83 1 6.48 1 9.31 1 9.34 1 8.93 1 6.34 1 6.52 1 5.79 1 6.73 1 8.38 1 7.15 1 7.24 1 7.7 1 6.28 1 5.83 1 6.45 1 5.97 1 7.33 5 6.9 5 6.64 5 7.24 5 7.49 5 9.79 5 7.24 5 7.77 5 7.17 5 7.57 5 6.2 5 6.43 5 7.67 5 6.4 5 6.9 5 6.64 5 7.24 5 7.49 2 9.1 2 9.15 2 9.07 2 9.1 2 7.11 2 7.52 2 8.56 2 8.09 2 7.81 2 7.9 2 7.18 2 7.06 2 8.01 2 8.15 2 8.44 2 8.36 2 8.57 2 8.04 2 7.94 2 7.02 2 9.5 2 9.8 2 6.94 2 6.58 2 8.23 2 8.71 2 9.37 2 9.37 2 7.5 2 9.56 2 7.72 2 7.72 2 8.6 2 7.01 2 7.62 2 7.1 2 9.53 2 8.87 2 7.31 2 8.77 2 8.72 2 8.68 2 6.9 2 6.64 2 7.24 2 7.49 2 9.79 2 7.24 2 7.77 2 7.17 2 7.57 2 6.2 2 6.43 2 7.67 2 6.4 6 6.9 6 6.64 6 7.24 6 7.49 6 9.79 6 7.24 6 7.77 6 7.17 6 7.57 6 6.2 6 6.43 6 7.67 6 6.4 3 9.25 3 9.27 3 9.81 3 9.33 3 9.08 3 8.38 3 8.72 3 7.56 3 8.1 3 8.27 3 8.27 3 8.88 3 8.17 3 8.12 3 7.5 3 8.63 3 8.93 3 7.6 3 7.73 3 8.05 3 9.81 3 8.58 3 8.5 3 9.07 3 8.6 3 9.56 3 9.83 3 6.95 3 7.81 3 8.3 3 9.87 4 9.16 4 9.24 4 9.4 4 9.5 4 9.5 4 9.5 4 8.26 4 7.96 4 7.53 4 7.74 4 8.22 4 7.54 4 8.82 4 8.7 4 8.98 4 8.12 4 8 4 8.78 4 8.8 4 7.4 4 8.17 4 8.85 4 8.3 4 8.7 4 8.07 4 7.6 4 7.05 4 6.26 4 6.9 4 7.04 4 7.84 4 10 4 8.3 4 8.44 4 7.62 4 8.9 4 8.27 4 9.46 4 9 4 9.5 4 8.06 4 8.32 4 8.46 4 9.28 4 8.15 4 9.94 4 8.38 4 7.8 4 7.64 4 8.66 4 7.84 4 7.85 4 8.25 4 9.92 4 8.9 4 7.92 4 8.14 4 10 4 9.2 4 9.06 4 8.72 4 8.84 4 9.65 4 8.16 4 8.66 7 9.5 7 8.88 7 9.15 7 7.9 7 8.57 7 8.44 7 7.06 7 7.5 7 7.78 7 7.11 7 9.3 8 9.16 8 8.38 8 6.58 8 9.07 8 6.94 8 8.15 8 7.5 8 7.52 8 7.8 8 9.05 8 7.52
David Winsemius
2010-Aug-17 12:16 UTC
[R] Wilcoxon test and grouping factor with multiple levels
On Aug 17, 2010, at 2:48 AM, Iurie Malai wrote:> Dear R users, > > I have a dataset with two variables: $esan - a grouping factor with 8 > levels and $reus. I'd like to do wilcox.test on this dataset as > sugested Weiwei here: > https://stat.ethz.ch/pipermail/r-help/2007-July/136627.html. I tried > to adapt his recommendation but no succes. Can anyone help me?That posting was showing how to perform a test where there were two factors and one numeric variable. You only have one so your example should simply be drawn from the help page for the function at the core of that recommendation: From earlier posting: > mytry <- by(myDat, INDICES=as.factor(myDat[,3]), FUN=function(x) { + pairwise.wilcox.test(as.numeric(as.character(x$Scores)), + + x $tissue, + + p.adjust.method = "none")$p.value + }) ... namely: ?pairwise.wilcox.test -- David Winsemius, MD West Hartford, CT
Dennis Murphy
2010-Aug-17 12:24 UTC
[R] Wilcoxon test and grouping factor with multiple levels
Hi: As the help page for wilcox.test() states (?wilcox.test), the test is meant for one or two groups. Since you have eight groups in your data, the help page for wilcox.test() suggests using kruskal.test() instead, where the latter function applies the Kruskal-Wallis test if your intention is to compare all eight groups simultaneously (analogous to one-way ANOVA). If you have something else in mind, perhaps you should clarify your intentions. HTH, Dennis On Mon, Aug 16, 2010 at 11:48 PM, Iurie Malai <iurie.malai@gmail.com> wrote:> Dear R users, > > I have a dataset with two variables: $esan - a grouping factor with 8 > levels and $reus. I'd like to do wilcox.test on this dataset as > sugested Weiwei here: > https://stat.ethz.ch/pipermail/r-help/2007-July/136627.html. I tried > to adapt his recommendation but no succes. Can anyone help me? > > > Regards, > > Iurie Malai, Senior Lecturer > Department of Psychology > Faculty of Psychology and Special Education > Ion Creanga Moldova Pedagogical State University > > ______________________________________________ > 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. > >[[alternative HTML version deleted]]
Iurie Malai
2010-Aug-17 16:26 UTC
[R] Wilcoxon test and grouping factor with multiple levels
Thank you, David Winsemius and Dennis Murphy! I want to compare pairs one by one. 2010/8/17 Iurie Malai <iurie.malai at gmail.com>:> Dear R users, > > I have a dataset with two variables: $esan - a grouping factor with 8 > levels and $reus. I'd like to do wilcox.test on this dataset as > sugested Weiwei here: > https://stat.ethz.ch/pipermail/r-help/2007-July/136627.html. I tried > to adapt his recommendation but no succes. Can anyone help me? > > > Regards, > > Iurie Malai, Senior Lecturer > Department of Psychology > Faculty of Psychology and Special Education > Ion Creanga Moldova Pedagogical State University >-- Iurie Malai, Senior Lecturer Department of Psychology Faculty of Psychology and Special Education Ion Creanga Moldova Pedagogical State University +(373)67171430 - Chisinau, Moldova +(39)066-2207218, ext. 684 - Rome,?Italy +(40)318-103743, ext. 457 - Bucharest,?Romania