Understanding the Wilcoxon Rank Sum and Signed Rank tests
The Wilcoxon Rank Sum and Signed Rank test (Mann-Whitney-Wilcoxon) is a nonparametric test of the null hypothesis that two different groups come from the same population without assuming the two groups are normally distributed. This recipe will show you how to conduct a Wilcoxon Rank Sum and Signed Rank test in R.
Getting ready
In this recipe, we will use the wilcox.test
function that originated from the stat
package.
How to do it…
Perform the following steps to conduct a Wilcoxon Rank Sum and Signed Rank test:
First, prepare the Facebook likes of a fan page:
> likes <- c(17,40,57,30,51,35,59,64,37,49,39,41,17,53,21,28,46,23,14,13,11,17,15,21,9,17,10,11,13,16,18,17,27,11,12,5,8,4,12,7,11,8,4,8,7,3,9,9,9,12,17,6,10)
Then, plot the Facebook Likes data into a histogram:
>hist(likes)
Now, perform a one-sample Wilcoxon signed rank test to determine whether the median of the input...