- Home
- Appointment Information
- Workshops
- Information for Staff
- Stats ResourcesToggle Dropdown
- Stats with SPSSToggle Dropdown
- Independent-Samples t-Test
- Paired-Samples t-Test
- Mann Whitney U-Test
- Wilcoxon Signed-Ranks Test
- One-Way Between-Subjects ANOVA
- One-Way Repeated-Measures ANOVA
- Two-Way Mixed ANOVA
- One-Way Between-Subjects ANCOVA
- Kruskal Wallis H-Test
- Friedman's ANOVA
- Pearson's 'r' Correlation
- Spearman's Rho Correlation
- Simple Linear Regression
- Multiple Linear Regression
- Chi-Squared (χ2) Test of Association
- Shapiro-Wilk Test of Normality
- Cronbach's Alpha

- Stats with R
- Stats with JamoviToggle Dropdown
- Maths ResourcesToggle Dropdown
- Numeracy ResourcesToggle Dropdown
- Stats/Maths Software
- A-Z of Terminology
- Meet the Team

A Wilcoxon test, sometimes called a Wilcoxon Signed-Rank Test, compares the means between two related groups, such as comparing the difference between pre-intervention and post-intervention test results.

It is considered a non-parametric test and therefore it is suitable for non-parametric data. To check if your data is parametric, please check our dedicated guide: **Parametric or Not Guide (PDF)**

If your data is parametric you should consider using a **Paired-Samples t-Test**

The Wilcoxon signed rank test is often referred to as simply the Wilcoxon test. It is different from the Wilcoxon rank sum test (also known as the Mann-Whitney U test), which is a test for independent samples. Both types of tests fall under the wilcox.test() function in R, with a “paired” argument denoting which of the two tests are run (FALSE/TRUE). By default, the argument is FALSE, meaning that the function will run a Mann-Whitney U test if we do not specify paired = TRUE.

This is used for when the data is structured using a grouping variable. A grouping variable is a categorical variable indicating which scores belong to different groups.

Data:

The first argument entered in the wilcox.test() function is a formula that takes the following structure:

dependent variable ~ independent variable

The second argument is the data frame.

The third argument needs to be “paired = TRUE”. The wilcox.test() function runs a Mann-Whitney U test by default, this is why we need to specify the option in order for it to run a Wilcoxon test.

`wilcox.test(Score ~ Time, pre_post1, paired = TRUE)`

```
##
## Wilcoxon signed rank test with continuity correction
##
## data: Score by Time
## V = 2858, p-value = 0.04329
## alternative hypothesis: true location shift is not equal to 0
```

This method is used when your data is structured into two separate variables. Both of your variables should be numeric.

Data:

Put both of your variables in the wilcox.test() function in any order. If you have your variables stored in a data frame, use the following structure to indicate the variable: data_frame$variable_name

The third argument needs to be “paired = TRUE”. The wilcox.test() function runs a Mann-Whitney U test by default, this is why we need to specify the option in order for it to run a Wilcoxon test.

`wilcox.test(pre_post2$Before, pre_post2$After, paired = TRUE)`

```
##
## Wilcoxon signed rank test with continuity correction
##
## data: pre_post2$Before and pre_post2$After
## V = 2858, p-value = 0.04329
## alternative hypothesis: true location shift is not equal to 0
```

R will generate largely the same output for both formula and variables methods.

The results of the tests will not include any descriptive statistics. As medians and inter-quartile ranges are commonly reported, please check our guide on **descriptive statistics**.

The table output shows the Wilcoxon signed-rank statistic (V) and the p-value.

*Mdn* = 73.00) after the intervention than before (*Mdn* = 72.00). A Wilcoxon Test indicated that this improvement, was statistically significant, *V *= 2858, *p *= .043.

- Last Updated: Jun 25, 2024 12:16 PM
- URL: https://guides.library.lincoln.ac.uk/mash
- Print Page

© University of Lincoln