Filipe Correia
2013-Oct-02 15:33 UTC
[R] Interpreting the result of a Wilcoxon (Mann-Whitney U) test
Hello everyone, I'm having some trouble interpreting the results of a Wilcoxon (Mann-Whitney U) test. Hope you can help. This is the R script that I am running: a <- c(1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 1, 5, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 1) b <- c(1, 2, 1, 1, 2, 3, 2, 2, 1, 2, 1, 1, 1, 2) wilcox.test(a, b, alternative="t", mu=0, exact=FALSE, paired=FALSE) #1st wilcox.test(a, b, alternative="l", mu=0, exact=FALSE, paired=FALSE) #2nd wilcox.test(a, b, alternative="g", mu=0, exact=FALSE, paired=FALSE) #3rd ... and it's returning: Wilcoxon rank sum test with continuity correction data: a and b W = 145, p-value = 0.08969 alternative hypothesis: true location shift is not equal to 0 Wilcoxon rank sum test with continuity correction data: a and b W = 145, p-value = 0.04485 alternative hypothesis: true location shift is less than 0 Wilcoxon rank sum test with continuity correction data: a and b W = 145, p-value = 0.9582 alternative hypothesis: true location shift is greater than 0 The null hypothesis is that the populations are equivalent (mu=0). The alternative hypothesis are that they differ, with the 2nd and 3rd runs of the test above considering respectively that a<b and b>a. Plus, I'm considering an alfa of 0.05. My issue is that from the first run I could not conclude that there was a difference between the two populations (0.08969>0.05), but the second run leads me to think that a<b (because 0.04485<0.05). Am I misinterpreting the results? Thanks! Filipe
Charles Determan Jr
2013-Oct-02 17:50 UTC
[R] Interpreting the result of a Wilcoxon (Mann-Whitney U) test
Filipe, When you chose a different alternative argument you are asking a different null hypothesis. You are looking at a two-tailed, lesser than, and greater than hypotheses. Which one you chose is dependent upon your initial question. Are you asking generically if your two populations (a and b) are different? Are you asking if a > b or a < b? It is my understanding that you shouldn't just do all of them to see which fits, it depends on what you initially were intending to test. If you can answer that question then you can determine if your appropriate run is significant. Regards, -- Charles Determan Integrated Biosciences PhD Candidate University of Minnesota On Wed, Oct 2, 2013 at 10:33 AM, Filipe Correia <fcorreia@gmail.com> wrote:> Hello everyone, > > I'm having some trouble interpreting the results of a Wilcoxon > (Mann-Whitney U) test. Hope you can help. > > This is the R script that I am running: > > a <- c(1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 1, 5, 1, 1, 1, 3, 1, 1, > 1, 1, 1, 1, 3, 1, 1) > b <- c(1, 2, 1, 1, 2, 3, 2, 2, 1, 2, 1, 1, 1, 2) > wilcox.test(a, b, alternative="t", mu=0, exact=FALSE, paired=FALSE) #1st > wilcox.test(a, b, alternative="l", mu=0, exact=FALSE, paired=FALSE) #2nd > wilcox.test(a, b, alternative="g", mu=0, exact=FALSE, paired=FALSE) #3rd > > ... and it's returning: > > Wilcoxon rank sum test with continuity correction data: a and b > W = 145, p-value = 0.08969 > alternative hypothesis: true location shift is not equal to 0 > > Wilcoxon rank sum test with continuity correction data: a and b > W = 145, p-value = 0.04485 > alternative hypothesis: true location shift is less than 0 > > Wilcoxon rank sum test with continuity correction data: a and b > W = 145, p-value = 0.9582 > alternative hypothesis: true location shift is greater than 0 > > The null hypothesis is that the populations are equivalent (mu=0). The > alternative hypothesis are that they differ, with the 2nd and 3rd runs > of the test above considering respectively that a<b and b>a. Plus, I'm > considering an alfa of 0.05. > > My issue is that from the first run I could not conclude that there > was a difference between the two populations (0.08969>0.05), but the > second run leads me to think that a<b (because 0.04485<0.05). > > Am I misinterpreting the results? > > Thanks! > > Filipe > > ______________________________________________ > 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]]
David Winsemius
2013-Oct-02 17:56 UTC
[R] Interpreting the result of a Wilcoxon (Mann-Whitney U) test
On Oct 2, 2013, at 8:33 AM, Filipe Correia wrote:> Hello everyone, > > I'm having some trouble interpreting the results of a Wilcoxon > (Mann-Whitney U) test. Hope you can help. > > This is the R script that I am running: > > a <- c(1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 1, 5, 1, 1, 1, 3, 1, 1, > 1, 1, 1, 1, 3, 1, 1) > b <- c(1, 2, 1, 1, 2, 3, 2, 2, 1, 2, 1, 1, 1, 2) > wilcox.test(a, b, alternative="t", mu=0, exact=FALSE, paired=FALSE) #1st > wilcox.test(a, b, alternative="l", mu=0, exact=FALSE, paired=FALSE) #2nd > wilcox.test(a, b, alternative="g", mu=0, exact=FALSE, paired=FALSE) #3rd > > ... and it's returning: > > Wilcoxon rank sum test with continuity correction data: a and b > W = 145, p-value = 0.08969 > alternative hypothesis: true location shift is not equal to 0 > > Wilcoxon rank sum test with continuity correction data: a and b > W = 145, p-value = 0.04485 > alternative hypothesis: true location shift is less than 0 > > Wilcoxon rank sum test with continuity correction data: a and b > W = 145, p-value = 0.9582 > alternative hypothesis: true location shift is greater than 0 > > The null hypothesis is that the populations are equivalent (mu=0). The > alternative hypothesis are that they differ, with the 2nd and 3rd runs > of the test above considering respectively that a<b and b>a. Plus, I'm > considering an alfa of 0.05. > > My issue is that from the first run I could not conclude that there > was a difference between the two populations (0.08969>0.05), but the > second run leads me to think that a<b (because 0.04485<0.05).This is not an appropriate question for R-help. You should ask your statistics instructor or pose the question in a venue where explanations of purely statistical problems are on-topic. (Just because you used R to get results that confused you does not make this an R-help-problem.)> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html-- David Winsemius Alameda, CA, USA
S Ellison
2013-Oct-03 11:05 UTC
[R] Interpreting the result of a Wilcoxon (Mann-Whitney U) test
> I'm having some trouble interpreting the results of a Wilcoxon > (Mann-Whitney U) test. Hope you can help.Two-tailed and one tailed tests generally give different p-values, with the two-tailed p-value twice (one of) the one-tailed values for rather obvious reasons. You need to sort out which question you wanted the answer to. Having said that, if a factor of two in the p-value changes your interpretation, you probably haven't got a really compelling result. S Ellison ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}}
S Ellison
2013-Oct-04 13:34 UTC
[R] Interpreting the result of a Wilcoxon (Mann-Whitney U) test
> -----Original Message----- > Got it! I agree it should had been more obvious to me... :)I wouldn't feel too bad about that. I've spent most of the last 25 years discovering the hard way that statistics is very much a field where things are 'obvious' only _after_ you know the answer... S ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}}
John Kane
2013-Oct-05 11:19 UTC
[R] Interpreting the result of a Wilcoxon (Mann-Whitney U) test
+1 John Kane Kingston ON Canada> -----Original Message----- > From: jim at bitwrit.com.au > Sent: Sat, 05 Oct 2013 17:16:35 +1000 > To: r-help at r-project.org > Subject: Re: [R] Interpreting the result of a Wilcoxon (Mann-Whitney U) > test > > On 10/04/2013 11:34 PM, S Ellison wrote: >> ... > >> Got it! I agree it should had been more obvious to me... :) >> I wouldn't feel too bad about that. I've spent most of the last 25 years >> discovering the hard way that statistics is very much a field where >> things are 'obvious' only _after_ you know the answer... >> > A fortune ("hindsight") if I ever saw one. > > Jim > > ______________________________________________ > 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.____________________________________________________________ FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family! Visit http://www.inbox.com/photosharing to find out more!