Computational Provenance & Reproducibility Record

RAISINS - R and AI Solutions for INferential Statistics · Online Statistical Analysis Platform for Agricultural Research

Computational Provenance & Reproducibility Record Mann-Whitney U test · 2.0.0 · DOI pending

Computational Provenance & Reproducibility Record

RAISINS · Mann-Whitney U 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 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

Go to the App from here

1 Module Metadata

Parameter Specification
Module Mann-Whitney U test
Module Version 2.0.0
DOI pending (Zenodo DOI not yet minted)
Document Type Computational workflow
Statistical Engine R
R Version 4.5.2
Reproducibility Execution Environment: Posit Connect · GCR · renv-locked

2 Statistical Dependency Manifest

Package Version Repository Core Statistical Functions
stats 4.5.2 Base R wilcox.test(), var.test(), mean(), median(), IQR(), sd()

3 Statistical Function Registry

Analytical Role Primary Function(s)
Variance homogeneity (reference only) stats::var.test()
Two-group rank-based comparison stats::wilcox.test()
Group descriptive statistics base::mean(), stats::median(), stats::IQR(), stats::sd()

4 Default Methods & Parameters

Analysis Step / Parameter Default Method / Value
Variance
Homogeneity

(var.test())
Test F-test for the ratio of two variances, reported alongside the rank-based result for reference. Applied for the unpaired design only
Consequence Informational only - unlike the RAISINS t-tests module, the outcome of this F-test does not change which test is applied; the Mann-Whitney U test does not assume homogeneous variances
Mann-Whitney
U Test

(wilcox.test())
Unpaired design (default) Independent two-group rank-sum test (paired = FALSE). Ranks the pooled observations from both groups and compares the rank sums. Requires the group column to contain exactly two levels
Paired design (paired = TRUE) Wilcoxon signed-rank test on the within-pair differences; the statistic is reported as "V value" instead of "W value"
Exactness exact = FALSE - the normal approximation with a continuity correction is used by default (reliable once each group has a handful of observations or more, and required whenever ties are present)
Alternative two.sided by default; less and greater optional
Confidence & scope Confidence level = 1 − α (default 95%) for the Hodges-Lehmann location-shift estimate (conf.int = TRUE); the grouping variable must contain exactly two levels, which may be of unequal size; results rounded to the user-selected number of decimal places (default 2)
Descriptive
Statistics
Per group, per variable Mean, Median, Interquartile Range (IQR), and Standard Deviation reported for each of the two groups alongside the test result

5 R Code for Key Analytical Steps

The code blocks below demonstrate the exact computation behind each reported result, using the same worked example distributed with the module (dataset1.csv: 15 “Treatment” vs 15 “Control” observations on Height, Weight, and Yield).

5.1 Variance Homogeneity (reference only)

df <- read.csv("dataset1.csv")
x <- df$Height[df$Group == "Treatment"]
y <- df$Height[df$Group == "Control"]

ftest <- var.test(x, y)   # F-test for equality of variances (reported for reference)
ftest

5.2 Mann-Whitney U Test

alpha <- 0.05

# --- Unpaired / independent groups (default) ---
mwtest <- wilcox.test(x, y,
                      alternative = "two.sided",   # or "less", "greater"
                      conf.int    = TRUE,
                      conf.level  = 1 - alpha,      # default 95%
                      paired      = FALSE,
                      exact       = FALSE)          # normal approximation
mwtest

# reported quantities
mean(x); mean(y)                                    # group means
median(x); median(y)                                # group medians
IQR(x); IQR(y)                                       # group interquartile ranges
mwtest$statistic                                     # W (U) statistic
mwtest$p.value                                       # p-value
mwtest$conf.int                                      # Hodges-Lehmann confidence interval
mwtest$estimate                                      # Hodges-Lehmann location-shift estimate

# --- Paired design (paired = TRUE) ---
# x[i] and y[i] are the two measurements on the same unit; this runs the
# Wilcoxon signed-rank test on the paired differences and the statistic is
# reported as "V value" in the app
wilcox.test(x, y,
            alternative = "two.sided",
            conf.level  = 1 - alpha,
            paired      = TRUE,
            exact       = FALSE)

5.3 Reproducing the worked-example table

vars <- c("Height", "Weight", "Yield")
digits <- 3

result_rows <- do.call(rbind, lapply(vars, function(v) {
  x <- df[df$Group == "Treatment", v]
  y <- df[df$Group == "Control",   v]
  wt <- wilcox.test(x, y, alternative = "two.sided",
                     conf.int = TRUE, conf.level = 0.95,
                     paired = FALSE, exact = FALSE)
  data.frame(
    Variable   = v,
    Mean_Trt   = round(mean(x), digits),
    Mean_Ctrl  = round(mean(y), digits),
    W_value    = round(unname(wt$statistic), digits),
    p_value    = format.pval(wt$p.value, digits = 4, eps = 1e-4)
  )
}))
result_rows
# Expected: Height W=225 p<0.0001 ; Weight W=225 p<0.0001 ; Yield W=225 p<0.0001

Explore the entire Mann-Whitney U test module in preview mode using our demo datasets. To submit suggestions or report a workflow issue, please use the discussion section below, or visit the official RAISINS website.

6 RAISINS Native Statistical Framework

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/

Wilcoxon, F. (1945). Individual comparisons by ranking methods. Biometrics Bulletin, 1(6), 80-83.

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.

Allaire, J. J., Xie, Y., Dervieux, C., McPherson, J., Luraschi, J., Ushey, K., Atkins, A., Wickham, H., Cheng, J., Chang, W., & Iannone, R. (2026). rmarkdown: Dynamic Documents for R (R package version 2.31). https://github.com/rstudio/rmarkdown

Feedback & Discussion