# Two related samples

**Description**

The Wilcoxon signed-rank test is a test of difference between related or paired samples using non-parametric data~~.~~

To undertake a Wilcoxon’s signed-test your data must meet two assumptions:

- It must be paired and come from the same population.
- The data must be measured of ordinal (within-pair comparison) or interval level data.

You can find out more about how to assess your data to see if it meets the assumptions for parametric tests **here. **

The Wilcoxon test produces two outputs, a test statistic (‘W’, ‘T’ or ‘Z’) as well as the p-value. The **‘W’ ‘V’, ‘T’ **or** ‘Z**’ all denote slightly different things:

**T**: is the smaller of the rank-totals, created as part of the analysis process. The smaller this value is the greater the probability a true difference is observed.**W**: is the sum of the signed ranks. In R this is reported as**‘V’****Z:**A conversion of the**W**value into a Z-score (which uses an approximation of a normal distribution)

**Advantages**

- Wilcoxon Signed-Rank is a robust statistical test that is not reliant upon assumptions of parametric data.

**Limitations**

- There are A LOT of ‘Wilcoxon’ tests and this can be confusing! (The Wilcoxon
*Sum Rank test is actually an alternative name for the Mann-Whitney U test)* - If you have less than five data points, Wilcoxon’s test will always receive a non-significant result.
- If your data is likely to contain many data values with no difference (e.g. 2-2 = 0) then the Wilcoxon test may produce erroneous results. Instead use the Wilcoxon-Pratt test which is modified to account for no difference pairs.

**Worked Example**

An example excel file (Wilcoxon Example) can be downloaded below:

- There are two columns ‘before’ and ‘after’ and ‘RandA’ and ‘RandB’
- There are 25 data points in each column. These values are from hypothetical participants but could represent data from
*before*and*after*an intervention - A significant difference should be seen when comparing ‘before’ and ‘after’ columns but not when comparing ‘RandA’ and ‘RandB’

**Instructions**

- Click on Analyse above
- Select .csv or .xlsx before uploading your file (example file is.xlsx)
- Upload your file
- Specify the ‘before’ variable column
- Specify the ‘after’ variable column
- Wait for Analysis to occur

* Summary t*ab

*'*presents quartiles and descriptive statistics

* Test statistics *tab presents the test statistics

__ Wilcoxon ranks__ presents the raw rank differences

__ Box plot__ presents the data as a box plot

**Interpreting the test statistic**

A Wilcoxon Signed-Rank test demonstrated a statistically significant difference between ‘before’ and ‘after’ (Z = -4.0514, p < 0.05) (Z = -4.0514, p-value = 5.722e-06)

By Daniel Richardson

__Resources__

__https://www.sheffield.ac.uk/polopoly_fs/1.885114!/file/64_Wilcoxon.pdf__

__https://cml.rhul.ac.uk/people/ptocca/Reports/20170227-WilcoxonReport.pdf__

__https://en.wikipedia.org/wiki/Wilcoxon_signed-rank_test__

__https://en.wikipedia.org/wiki/Mann–Whitney_U_test__