This article describes how to perform the Wilcoxon rank-sum test to compare the median between two samples.
This test can be applied to two samples of equal or different sizes. For paired samples see Test - Nonparametric - Paired Samples Wilcoxon Test.
Requirements
A Displayr document with a data set.
Method
- From the Report tree select + > Advanced Analysis > Test > Nonparametric > Two Sample Wilcoxon Rank Sum Test.
- Specify the outcome variable to use under Object Inspector
> Data > Two-Sample Wilcoxon Test > Outcome. The outcome variable is the variable whose sample is to be analyzed.
- Under Object Inspector
> Data > Two-Sample Wilcoxon Test > Group, specify the variable that each observation comes from. When this variable is numeric, it is automatically grouped into approximately equal-sized groups using the median and then converted by the function.
OPTIONAL: You can modify the following settings to adjust the output:
- mu - Difference in the median of the two samples, as assumed under the null hypothesis.
- Alternative hypothesis - Use a two-sided or one-sided test.
- Type of test - Method by which the p-value is computed.
-
Output
- Summary - Shows a nicely formatted table of the test results (default).
- R - The original text-based output from the wilcox.test function.
- Variable names - Display Variable Names in the output, instead of Variable Labels.
- More decimal places - Display numeric values with 8 decimal places.