# Wilcoxon test (paired samples)

Command: | Statistics Rank sum tests Wilcoxon test (paired samples) |

## Description

The **Wilcoxon test for paired samples** is the non-parametric equivalent of the paired samples t-test. It should be used when the sample data are not Normally distributed, and they cannot be transformed to a Normal distribution by means of a logarithmic transformation.

## Required input

Select the variables for sample 1 and sample 2, and a possible filter for the data pairs. You can use the button to select variables and filters in the variables list.

## Results

### Summary statistics

The results windows for the Wilcoxon test first displays summary statistics of the two samples. Note that only cases are included with data available for the two variables, therefore the sample size will always be equal.

The statistics include the Hodges-Lehmann median difference (the Hodges-Lehmann estimate of location shift) and its 95% confidence interval (Conover, 1999). The Hodges-Lehmann median difference between two paired samples with sample size *n* is calculated as follows: first the *n* paired differences are calculated. For each possible set of 2 differences, the average is calculated. The Hodges-Lehmann median difference is the median of all *n* × *(n+1) / 2* averages. The confidence interval is derived according to Conover (1999, p. 360).

Note that the Hodges-Lehmann median difference is not necessarily the same as the difference between the medians.

### Wilcoxon test results

The Wilcoxon test (for paired samples) ranks the absolute values of the differences between the paired observations in sample 1 and sample 2 and calculates a statistic on the number of negative and positive differences (differences are calculated as sample 2 − sample 1).

If the resulting P-value is small (P<0.05) then it can be accepted that the median of the differences between the paired observations is statistically significantly different from 0.

Note that in MedCalc P-values are always two-sided.

## Literature

- Altman DG (1991) Practical statistics for medical research. London: Chapman and Hall.
- Conover WJ (1999) Practical nonparametric statistics, 3
^{rd}edition. New York: John Wiley & Sons.