Computational Provenance & Reproducibility RecordMann-Whitney U and Wilcoxon Signed-Rank Test · 2.0.0 · DOI 10.5281/zenodo.22023869
Computational Provenance & Reproducibility Record
RAISINS · Mann-Whitney U and Wilcoxon Signed-Rank Test Module
This Computational Provenance Record documents the statistical computing environment, software dependencies, computational provenance, and bibliographic references associated with the RAISINS Mann-Whitney U and Wilcoxon Signed-Rank Test module. It is intended to support computational reproducibility and software transparency. Detailed statistical methodology, mathematical derivations, and user guidance are provided separately in the official module documentation.
Any issues or updates required please comment here
Mann-Whitney U test (W statistic, p-value) - two independent groups
stats::wilcox.test(paired = FALSE)
Wilcoxon Signed-Rank test (V statistic, p-value) - paired observations
stats::wilcox.test(paired = TRUE)
Hodges-Lehmann location-shift estimate and its confidence interval
stats::wilcox.test(conf.int = TRUE)
Descriptive statistics (mean, median, IQR) per group per response variable
base::mean(), stats::median(), stats::IQR()
Q-Q assessment of each group’s distributional shape
ggplot2::stat_qq(), ggplot2::stat_qq_line()
4 Default Methods & Parameters
Analysis
Step / Parameter
Default Method / Value
Rank-based
two-sample test
Test type
User-selectable via a "Select Test type" control. Mann-Whitney U Test (default) for two independent groups, or Wilcoxon Signed-Rank Test when the same experimental units are measured twice. Both are computed by stats::wilcox.test(), which is called with paired = FALSE or paired = TRUE accordingly. Applied independently, per selected response variable
Test statistic
W (rank-sum) for the unpaired test; V (signed-rank sum) for the paired test. The results table labels the column accordingly and records the test actually used in a "Test Used" column
Exact vs normal approximation
exact = FALSE - the normal approximation is used at all sample sizes, so that a confidence interval is always returned and results remain well defined in the presence of tied ranks
Grouping requirement
The selected Group column must contain exactly two levels; the module stops with a message if it does not
Hypotheses
Alternative hypothesis
User-selectable: "Medians are not equal" (two.sided, default), "Median 1 is less than Median 2" (less), or "Median 1 is greater than Median 2" (greater)
Significance level
User-selectable via a "Level of significance (α)" control; α = 0.05 by default
Confidence
Interval
Construction
conf.int = TRUE with conf.level = 1 - α, giving the Hodges-Lehmann estimate of the location shift between the two groups together with its distribution-free confidence interval. Reported as a "(lower, upper)" pair at the chosen α
Significance
stars
Thresholds
p < 0.01 → ***; p < 0.05 → **; p < 0.10 → *; otherwise NS (not significant)
Descriptive
Statistics
Per group, per response variable
Mean, median and interquartile range, computed on the raw (unranked) values within each group via base::mean(), stats::median() and stats::IQR()
Rounding
All reported values are formatted to the user-selected number of decimal places (default 2) via formatC()
Plots
Box & Violin, Raincloud, Beeswarm, Stripchart, Distribution (Half-Eye), Q-Q
Six plot types chosen from an icon panel, all built from the same two-group data and the same statistic and p-value as the results table, so any value annotated on a plot is traceable to the same underlying computation as the table
5 R Code for Key Analytical Steps
The code blocks below demonstrate the exact computation behind each reported result. They use datasets that ship with base R (the datasets package), so anyone can run them as they stand, with no file to download and nothing to install:
Dataset
Design
Used to demonstrate
ToothGrowth
60 guinea pigs, tooth length by supplement type (OJ vs VC), 30 per group - independent
Mann-Whitney U test
sleep
10 subjects, extra hours of sleep under two drugs, each subject measured twice - paired
Wilcoxon Signed-Rank test
The values shown in the comments were produced under R 4.5.2 with alpha = 0.05, and are what you should obtain if the computation is reproduced correctly.
5.1 Mann-Whitney U test (two independent groups)
# ToothGrowth: tooth length under two supplements, 30 guinea pigs eachx <- ToothGrowth$len[ToothGrowth$supp =="OJ"]y <- ToothGrowth$len[ToothGrowth$supp =="VC"]alpha <-0.05test <-wilcox.test(x, y,alternative ="two.sided", # user-selectableconf.int =TRUE,conf.level =1- alpha,paired =FALSE, # Mann-Whitney Uexact =FALSE)test$statistic # W value -> 575.5test$p.value # -> 0.06449test$conf.int # Hodges-Lehmann CI for the location shift -> (-0.100, 8.500)
5.2 Wilcoxon Signed-Rank test (paired observations)
# sleep: the SAME 10 subjects measured under two drugs, so the rows pair upa <- sleep$extra[sleep$group ==1]b <- sleep$extra[sleep$group ==2]# the paired test requires equal group sizes; pairs are matched by positionlength(a) ==length(b) # -> TRUE (10 pairs)# identical call, with paired = TRUE; the statistic is then reported as Vtest_paired <-wilcox.test(a, b,alternative ="two.sided",conf.int =TRUE,conf.level =1- alpha,paired =TRUE, # Wilcoxon Signed-Rankexact =FALSE)test_paired$statistic # V value -> 0test_paired$p.value # -> 0.009091test_paired$conf.int # -> (-2.950, -1.050)
5.3 Descriptive statistics reported alongside the test
RAISINS uses R for all its statistical computations. Every package used to generate major results is listed and demonstrated with examples, so results can be reproduced independently. These results are then organized and formatted on the RAISINS website along with visualisation to make them easier to use and interpret. RAISINS also has its own custom-built statistical tools for managing workflows, validating results, and generating reports. Details of these are not fully covered here, they’re shared with outside researchers only on request, and are subject to licensing terms.
7 Package References
R Core Team. (2025). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. https://www.R-project.org/
Wickham, H. (2016). ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York. https://ggplot2.tidyverse.org
Clarke, E., & Sherrill-Mix, S. (2023). ggbeeswarm: Categorical Scatter (Violin Point) Plots (R package version 0.7.3). https://CRAN.R-project.org/package=ggbeeswarm
Tiedemann, F. (2022). gghalves: Compose Half-Half Plots Using Your Favourite Geoms (R package version 0.1.4). https://CRAN.R-project.org/package=gghalves
Kay, M. (2024). ggdist: Visualizations of Distributions and Uncertainty (R package version 3.3.3). https://CRAN.R-project.org/package=ggdist
Pedersen, T. L. (2024). patchwork: The Composer of Plots (R package version 1.3.2). https://CRAN.R-project.org/package=patchwork
Wilcoxon, F. (1945). Individual Comparisons by Ranking Methods. Biometrics Bulletin, 1(6), 80-83. https://doi.org/10.2307/3001968
Mann, H. B., & Whitney, D. R. (1947). On a Test of Whether one of Two Random Variables is Stochastically Larger than the Other. The Annals of Mathematical Statistics, 18(1), 50-60. https://doi.org/10.1214/aoms/1177730491
Hodges, J. L., & Lehmann, E. L. (1963). Estimates of Location Based on Rank Tests. The Annals of Mathematical Statistics, 34(2), 598-611. https://doi.org/10.1214/aoms/1177704172