Skip to content
Celeus

Wilcoxon signed-rank test

Shown in the app as wilcoxon_signed_rank. Part of the method reference, under Comparing groups.

When to use

Two paired measurements, non-normal differences.

What you provide

  • The two paired measurements: two numeric columns.

Options

Missing data

  • Complete case (listwise deletion)
  • Mean imputation (single)
  • Median imputation (single)

Multiple comparisons

  • Not adjustable for this method. Where it makes post-hoc comparisons, the procedure applies its own correction.

Confidence level

Every interval in the result is reported at the level you choose:

  • 90%
  • 95%
  • 99%

Alternative hypothesis

Two-sided unless you choose otherwise. Choose a one-sided test only when the direction was specified before the data were seen; the result then says so.

  • Two-sided: the first differs from the second in either direction
  • One-sided: the first is lower than the second
  • One-sided: the first is higher than the second

Alternatives that take the same inputs:

Other methods under Comparing groups:

Guides that discuss this method

How to read the output

These methods compare two measurements taken on the same units, for example the same students before and after a course, or the same field plots in two seasons. The analysis works on the difference within each pair, so variation between units does not blur the comparison.

Paired t-test. The estimate is the mean of the paired differences (first measurement minus second), with its 95% confidence interval. An interval that excludes 0 corresponds to p below 0.05. The effect size is Cohen’s d for paired data. The test assumes the differences, not the raw measurements, are roughly normally distributed, which is what its normality check looks at.

Wilcoxon signed-rank test. This rank test makes no normality assumption about the differences. The estimate is the Hodges-Lehmann estimate of the typical paired difference, with its confidence interval. The effect size is the rank-biserial correlation, from -1 to 1, where 0 means increases and decreases are balanced.

In both, the p-value is the probability of differences at least this far from zero if there were truly no change. It says nothing about how large the change is, so read the estimate and its interval first.

Sources: Student (1908), Biometrika 6(1):1-25, doi:10.2307/2331554. Wilcoxon F (1945), Biometrics Bulletin 1(6):80-83, doi:10.2307/3001968.

Worked examples

Celeus's result on a published or illustrative dataset, next to an independent computation and, where one exists, a published value. The data themselves are not reproduced here.

datasets::sleep

  • Source: Published dataset distributed with an R package
  • Licence: base R (GPL)
  • Reference: Student (1908)
QuantityCeleusIndependent computationPublished valueAgrees
p-value0.003906250.00390625-Yes
Estimate-1.3-1.3-Yes
Confidence interval-2.7, -0.9-2.7, -0.9-Yes
Effect size-1-1-Yes

datasets::sleep

  • Source: Published dataset distributed with an R package
  • Licence: base R (GPL)
  • Reference: Student (1908), Biometrika 6(1):1-25
QuantityCeleusIndependent computationPublished valueAgrees
Test statistic00-Yes
p-value0.003906250.00390625-Yes
Estimate-1.3-1.3-Yes
Confidence interval-2.1, -1.0-2.1, -1.0-Yes
Number of pairs with zero difference11-Yes

Hamilton depression scale, 9 patients (stats::wilcox.test help example)

  • Source: Published dataset distributed with an R package
  • Licence: base R (GPL)
  • Reference: Hollander & Wolfe (1973), Nonparametric Statistical Methods, p. 29
QuantityCeleusIndependent computationPublished valueAgrees
Test statistic4040-Yes
p-value0.01953120.0195312-Yes
Estimate0.460.46-Yes
Lower confidence limit0.1750.175-Yes

MASS::anorexia (family therapy arm)

  • Source: Published dataset distributed with an R package
  • Licence: MASS (GPL)
  • Reference: Hand et al. (1994), A Handbook of Small Data Sets
QuantityCeleusIndependent computationPublished valueAgrees
Test statistic1111-Yes
p-value0.0008392330.000839233-Yes
Estimate-7.65-7.65-Yes
Confidence interval-11.20, -3.45-11.20, -3.45-Yes

synthetic example (n=2 paired observations)

  • Source: Illustrative or synthetic example data
  • Licence: n/a (synthetic data written for this check, not sourced)
  • Reference: Hand-authored synthetic fixture, not sourced or published data; values chosen only to be non-degenerate (no ties, nonzero variance in the paired difference).
QuantityCeleusIndependent computationPublished valueAgrees
p-value11-Yes

Validation report

References

  1. Wilcoxon, F. (1945). Individual comparisons by ranking methods. Biometrics Bulletin 1: 80-83. doi:10.2307/3001968 doi:10.2307/3001968
  2. Hodges, J. L., Lehmann, E. L. (1963). Estimates of location based on rank tests. The Annals of Mathematical Statistics 34: 598-611. doi:10.1214/aoms/1177704172 doi:10.1214/aoms/1177704172