Atlas
statminds
Nonparametric (Paired-Rank Model)The underlying model family class (e.g. GLM, linear model, categorical matrix, log-linear).Parametric ReferenceStatistical methods that assume a specific probability distribution family (typically normal).12-stage workflow

Wilcoxon Signed-Rank Test

The engine for Robust Internal Discovery. This model audits the magnitude and direction of change within the same participants, providing a high-fidelity shield against outliers in paired data.

Model familyNonparametric (Paired-Rank Model)
Hypothesistwo-tailed
AliasesWilcoxon Matched-Pairs Test · Dependent-Samples Rank Test · Paired Rank-Sum Strike
G1
Internal Shift Audit
Determine if there is a consistent directional 'flip' in scores within the same group over time.
G2
Magnitude-Weighted Ranks
Account for both the *sign* and the *size* of the change without assuming a normal distribution of differences.
G3
Outlier-Resistant Trajectory
Isolate the recovery signal in skewed pre-post samples where a few extreme deltas would hijack a t-test.
Visual Overview Dashboard
1

What is it?

Wilcoxon Signed-Rank Test compares ranked paired metrics. Nonparametric alternative to Paired T-Test.

2

When to use it

  • Dependent Pairs: Linked pre/post measurements from identical subjects.
  • Non-Normal differences: Skewed scores where differences cannot assume normality.
3

Core Idea

Focuses on differences between pairs, sorting by absolute magnitude and signing by direction. Consistently positive slopes dominate rank sums:

Rank 1 (-)Rank 2 (+)
4

Hypotheses

H0: Median difference between paired groups is 0
Ha: Median difference is significantly non-zero
5

How it works

  1. Compute difference (d = Post - Pre) for each subject pair.
  2. Rank absolute differences, ignoring zeros.
  3. Sum positive signed ranks (W+) and negative signed ranks (W-).
  4. Use smallest sum (W) to evaluate critical probability.
6

Assumptions

📊 Ordinal Differences: Differences can be ordered/ranked.
👤 Paired Pairs: Dependent measurements taken from identical units.
7

Effect Size

Match rank-biserial correlation: **r = W / S** where S represents the total sum of absolute ranks. Scales from -1.0 to +1.0.

8

Quick Example

SubjectPrePostSigned Rank
S17078+2.0
S26562-1.0
Interactive Sandbox

Wilcoxon Signed-Rank Live Laboratory

Change the average paired shift to see positive (green) and negative (amber) rank assignments split.

Presets
Mean Shift Difference3.0
Difference SD3.0
Pair Count (N)12
Pre vs. Post Slope Lines labeled with signed rank magnitudesGreen lines indicate increase, Amber lines indicate decrease
PREPOST+1-2-3-4-5-6+7+8+9+10+11+12
Calculations Output
MetricValue
Sum of Positive Ranks (W+)58
Sum of Negative Ranks (W-)20
Wilcoxon W statistic20
p-value0.1444
Statistical Verdict
❌ No Significant Shift
Positive and negative shifts are balanced randomly (W = 20, p = 0.144). Fail to reject H0.
The 12-Stage Precision Workflow
01Directional Parity
Hypotheses
We test the null of 'Zero Median Shift' against the discovery of a systematic internal recovery or decline.
02Symmetry Mandate
Assumptions
The 'Hidden Requirement': The distribution of difference scores should be approximately symmetric, even if not normal.
03Zero-Difference Handling
Diagnostics
Checking the 'Tie-Density'—how many participants showed no change? These are often discarded, which can impact power.
04focus
Auditing FlowMotion participants' Pain Ranks at Baseline vs. 12-week follow-up in a pilot study with extreme skewness.
05Sign Test Pivot
Alternatives
Knowing when to switch to the Sign Test if your differences are extremely asymmetric and only the 'Direction' (Up/Down) can be trusted.
06W-Statistic Strike
Significance
Calculating the 'W'— the sum of ranks for positive differences—a precision strike on the internal movement of the data.
07Rank-Biserial r
Effect Size
Quantifying the strength of the internal bond: interpreting the percentage of the 'Total Rank Potential' captured by the shift.
08The Power Advantage
Sample Size
Exploiting the within-person multiplier—Wilcoxon is often 95% as efficient as a paired t-test even on perfectly normal data.
09The Delta Narrative
Reporting
Reporting Medians of differences and the W-statistic: 'Participants showed a significant recovery rank shift, W = X.XX, p = .XXX.'
10Wilcox.test(Paired=T)
Software
Executing the 'paired = TRUE' flag, ensuring the algorithm correctly pairs observations and ranks the deltas.
11focus
The fatal error of ranking all scores together instead of ranking the *differences*—this collapses the paired logic entirely.
12focus
Tracing the model back to Frank Wilcoxon (1945) and the foundational shift toward matched-pair non-parametric forensics.
01Hypothesis test logic

Hypotheses

Pragmatic null and alternative hypotheses defined in mathematical notation.

A hypothesis is a question sharpened to a point. Ambiguity is the enemy of inference.
Logic Core
Null · H₀

H₀: The median of paired differences is zero (differences are symmetrically distributed around zero)

Alternative · Hₐ

Hₐ: The median of paired differences is not zero

Why it matters two-tailed

Tests whether paired differences are symmetrically distributed around zero via signed ranks. IMPORTANT: Only interpretable as a median test when differences are symmetrically distributed. Otherwise, it tests stochastic dominance of positive vs. negative differences.

02Model diagnostics

Assumptions

The core mathematical criteria needed to ensure that statistical testing remains unbiased and valid.

Build your analysis on rock, not sand. Verify the mathematical foundation before building the model.
Integrity Shield
6
Assumptions
3
Critical / High Severity
How to check
Quick
Verify study design: repeated measures (pre-post), matched pairs, or within-subjects design. Check that each subject/unit has exactly 2 measurements
Rigorous
Confirm data structure has paired rows or wide format with 2 columns per subject. For matched pairs, verify matching criteria (age, gender, etc.). Check no subjects have missing values in either condition
If violated
If independent groups (not paired) → use Mann-Whitney U test. If more than 2 time points → use Friedman test. If hierarchical/clustered data → use linear mixed models with random effects
mann whitneyfriedmanlinear mixed model
How to check
Quick
Inspect variable type; verify differences have meaningful ordering and magnitude. For continuous data with non-normal differences, Wilcoxon is appropriate alternative to paired t-test
Rigorous
Calculate differences (Time2 - Time1). Check distribution with histogram and Q-Q plot. Run Shapiro-Wilk test on differences: if p < .05, non-normal → Wilcoxon appropriate. If ordinal, verify scale has ordered categories
If violated
If differences are nominal (no ordering) → use McNemar's test for binary outcomes or Cochran's Q for multiple categories. If differences are normally distributed → use paired t-test (more powerful)
mcnemarpaired t test
How to check
Quick
Design review: check that pairs/subjects are independent (no clustering, no repeated pairs). Within-pair dependence is expected and appropriate; between-pair independence is required
Rigorous
Check for clustering indicators (family ID, school ID, therapist ID). Verify no subject appears in multiple pairs. For time series, check autocorrelation of differences using ACF plots or Durbin-Watson test
If violated
If pairs are clustered (e.g., multiple pairs per family) → use linear mixed model with random effects for clusters. If time series with autocorrelation → use time series methods or GEE. If crossover design with carryover effects → include washout period or model carryover explicitly
linear mixed modelgee
How to check
Quick
Create histogram of differences (Time2 - Time1). Visual inspection: should be approximately symmetric (mirror image around center). Check skewness statistic: |skew| < 1 suggests reasonable symmetry
Rigorous
Formal symmetry test: Wilcoxon test assumes symmetric differences for median interpretation. Calculate skewness coefficient: |skew| < 0.5 is mild, 0.5-1.0 is moderate, >1.0 is severe. Use quantile-quantile symmetry plot (plot differences vs. -differences)
If violated
If differences are skewed: (1) Wilcoxon still valid but tests stochastic dominance (not specifically median), report as 'distribution of differences differs from zero'; (2) Use Sign test (no symmetry assumption, less powerful); (3) Transform differences (log, sqrt) to achieve symmetry; (4) Use bootstrap confidence intervals; (5) Use quantile regression to test specific percentile (e.g., 50th = median)
sign testquantile regression
How to check
Quick
Verify that differences (Time2 - Time1) are interpretable. For interval/ratio scales, differences have clear meaning (e.g., 5-point change). For ordinal scales, verify that rank ordering of difference magnitudes is meaningful
Rigorous
For ordinal data: assess whether difference between ranks 1-2 is comparable to difference between ranks 4-5. If not (e.g., Likert scales where intervals are unequal), consider whether Wilcoxon's use of difference magnitudes is appropriate vs. Sign test which only uses direction
If violated
If difference magnitudes are not meaningful (e.g., purely ordinal data with unequal intervals) → use Sign test (only uses direction: +, -, not magnitude). If differences are on nominal scale → inappropriate for Wilcoxon, use McNemar's test for binary changes
sign testmcnemar
How to check
Quick
Count number of zero differences (Time2 - Time1 = 0). Software typically excludes these automatically. High proportion of zeros (>20%) may indicate measurement insensitivity or ceiling/floor effects
Rigorous
Calculate proportion of zero differences. If >20%, investigate: (1) Are there floor/ceiling effects in measurement? (2) Is measurement resolution adequate? (3) Consider exact tests or methods that handle ties differently
If violated
If many zero differences: (1) Zeros are automatically excluded (reduces effective n); (2) Consider whether measurement scale is sensitive enough; (3) For many ties at non-zero values, use exact Wilcoxon test or permutation test; (4) Report number of ties and effective sample size; (5) Pratt's modification retains zero differences ranked as smallest
03Residual Forensics

Diagnostics

Checking residual plots and indices to examine model deviations and ensure standard error integrity.

Trust, but verify. The outliers often hold more truth than the averages.
System Health
Essential checks
  1. Histogram of differences (Time2 - Time1) to check symmetry
  2. Check for zero differences and ties
  3. Count and report effective sample size (n after excluding zeros)
Recommended checks
  1. Boxplot of differences to identify outliers
  2. Q-Q plot of differences vs. normal (if considering paired t-test instead)
  3. Shapiro-Wilk test on differences (if p > .05, consider paired t-test)
  4. Skewness coefficient to quantify asymmetry
  5. Scatter plot of paired observations (Time1 vs. Time2)
  6. Stem-and-leaf plot or dot plot of differences
04Live Instances

Applied Minds

Review concrete study examples, data layout guidelines, and copy executable syntax scripts.

Theory is the map. Practice is the terrain. Simulation bridges the gap.
Applied Wisdom
Example 01

Mindfulness Meditation for Sleep Quality (Pre-Post Design)

Research question: Does 8-week mindfulness meditation improve sleep quality in adults with insomnia? Design: Pre-post within-subjects (n=45). Outcome: Pittsburgh Sleep Quality Index (PSQI) score before and after intervention (range 0-21, higher = worse sleep, non-normal distribution with right skew). Wilcoxon used because PSQI differences violated normality (Shapiro-Wilk p = .018).

DesignPre-post repeated measures
Outcome ScalePSQI sleep quality score (0-21, ordinal/continuous)
# Wilcoxon Signed-Rank Test: Mindfulness → Sleep Quality
# Pre-post design with non-normal differences

library(tidyverse)
library(rstatix)      # For Wilcoxon with effect sizes
library(DescTools)    # For Hodges-Lehmann estimator
library(coin)         # For exact Wilcoxon test

# Simulate realistic data (or load: data <- read.csv("sleep_data.csv"))
set.seed(2025)
n <- 45
data <- data.frame(
  participant_id = 1:n,
  psqi_pre = round(rnorm(n, mean=12.3, sd=3.1)),   # Pre: M=12.3, SD=3.1
  psqi_post = round(rnorm(n, mean=8.7, sd=2.9))    # Post: M=8.7, SD=2.9
)
# Add some skewness to differences (realistic for PSQI)
data$psqi_post <- pmax(0, data$psqi_post)  # Floor at 0
data$difference <- data$psqi_post - data$psqi_pre

# === STEP 1: Check Assumptions ===

# 1. Paired design (verified by study design)
cat("Sample size:", nrow(data), "paired observations\n")

# 2. Check for zero differences
zero_diffs <- sum(data$difference == 0)
cat("Zero differences:", zero_diffs, "pairs(will be excluded)\n")
cat("Effective n =", n - zero_diffs, "\n\n")

# 3. Check symmetry of differences (key assumption)
cat("=== Symmetry Check ===\n")
cat("Skewness:", round(moments::skewness(data$difference), 3), "\n")
cat("(|skew| < 0.5: mild, 0.5-1: moderate, >1: severe)\n\n")

# Visual check: histogram
ggplot(data, aes(x = difference)) +
  geom_histogram(bins=15, fill="steelblue", alpha=0.7, color="black") +
  geom_vline(xintercept=0, linetype="dashed", color="red", linewidth=1) +
  labs(title="Distribution of Differences(Post - Pre PSQI)",
       subtitle="Check for symmetry around zero",
       x="PSQI Difference(Post - Pre)", y="Frequency") +
  theme_minimal()

# 4. Check normality (for comparison with paired t-test)
shapiro.test(data$difference)
# If p < .05 → non-normal, Wilcoxon appropriate

# Q-Q plot
ggplot(data, aes(sample = difference)) +
  stat_qq() + stat_qq_line(color="red") +
  labs(title="Q-Q Plot: Differences",
       subtitle="Deviation from line indicates non-normality") +
  theme_minimal()

# === STEP 2: Descriptive Statistics ===
cat("\n=== Descriptive Statistics ===\n")
cat("Pre-intervention PSQI:\n")
cat("  Median =", median(data$psqi_pre), ", IQR =", IQR(data$psqi_pre), "\n")
cat("Post-intervention PSQI:\n")
cat("  Median =", median(data$psqi_post), ", IQR =", IQR(data$psqi_post), "\n\n")

# === STEP 3: Wilcoxon Signed-Rank Test ===

# Method 1: Base R (with confidence interval)
wilcox_result <- wilcox.test(data$psqi_post, data$psqi_pre, 
                              paired = TRUE, 
                              conf.int = TRUE,
                              conf.level = 0.95)
print(wilcox_result)

# Method 2: rstatix (includes effect size)
wilcox_detailed <- wilcox_test(data, psqi_post ~ psqi_pre, paired=TRUE)
print(wilcox_detailed)

# Effect size: rank biserial correlation
effect <- wilcox_effsize(data, psqi_post ~ psqi_pre, paired=TRUE)
print(effect)
# Interpretation: |r| = .10 (small), .30 (medium), .50 (large)

# === STEP 4: Effect Size & CI ===

# Hodges-Lehmann estimator (robust median difference with CI)
hl_est <- HodgesLehmann(data$psqi_post, data$psqi_pre, conf.level=0.95)
cat("\nHodges-Lehmann estimator(median difference):\n")
cat("  Estimate:", round(hl_est[1], 2), "\n")
cat("  95% CI: [", round(hl_est[2], 2), ",", round(hl_est[3], 2), "]\n\n")

# Manual effect size: r = Z / sqrt(n)
Z <- qnorm(wilcox_result$p.value/2)  # Two-tailed
r_effect <- abs(Z) / sqrt(n)
cat("Wilcoxon r =", round(r_effect, 3), "\n")

# === STEP 5: Exact Test (if n < 50 or ties present) ===
# exact_test <- wilcoxsign_test(difference ~ 1, data=data, distribution="exact")
# print(exact_test)

# === STEP 6: Visualize Results ===

# Paired data visualization
data_long <- data %>%
  select(participant_id, psqi_pre, psqi_post) %>%
  pivot_longer(cols = c(psqi_pre, psqi_post), 
               names_to = "time", values_to = "psqi") %>%
  mutate(time = factor(time, levels=c("psqi_pre", "psqi_post"),
                       labels=c("Pre", "Post")))

ggplot(data_long, aes(x=time, y=psqi, fill=time)) +
  geom_boxplot(alpha=0.6, outlier.shape=NA) +
  geom_jitter(width=0.1, alpha=0.3, size=2) +
  geom_line(aes(group=participant_id), alpha=0.2) +
  stat_summary(fun=median, geom="point", size=4, color="red", shape=18) +
  labs(title="PSQI Sleep Quality: Pre vs. Post Mindfulness",
       subtitle="Lower scores = better sleep quality",
       x="Time Point", y="PSQI Score") +
  scale_fill_brewer(palette="Set2") +
  theme_minimal() +
  theme(legend.position="none")

# Difference plot
ggplot(data, aes(x=difference)) +
  geom_histogram(aes(y=..density..), bins=15, fill="steelblue", alpha=0.5) +
  geom_density(color="darkblue", linewidth=1) +
  geom_vline(xintercept=median(data$difference), color="red", 
             linetype="dashed", linewidth=1) +
  annotate("text", x=median(data$difference)-0.5, y=0.15, 
           label=paste("Median =", round(median(data$difference),1)), 
           hjust=1, color="red") +
  labs(title="Distribution of PSQI Changes",
       x="PSQI Difference(Post - Pre)", y="Density") +
  theme_minimal()

# === APA-Style Reporting ===
cat("\n=== APA Report ===\n")
cat(paste0(
  "A Wilcoxon signed-rank test was conducted to compare PSQI sleep quality ",
  "scores before and after an 8-week mindfulness meditation intervention. ",
  "Differences were non-normally distributed(Shapiro-Wilk W = 0.94, p = .018) ",
  "and showed moderate right skewness(skew = 0.65), justifying nonparametric analysis. ",
  "There was a significant reduction in PSQI scores from pre-intervention ",
  "(Mdn = ", median(data$psqi_pre), ", IQR = ", IQR(data$psqi_pre), ") to post-intervention ",
  "(Mdn = ", median(data$psqi_post), ", IQR = ", IQR(data$psqi_post), "), ",
  "Z = ", round(wilcox_detailed$statistic, 2), ", p < .001, ",
  "rank biserial r = ", round(effect$effsize, 2), " (large effect). ",
  "The Hodges-Lehmann estimate of median PSQI reduction was ",
  round(abs(hl_est[1]), 1), " points, 95% CI [", 
  round(abs(hl_est[3]), 1), ", ", round(abs(hl_est[2]), 1), "]. ",
  "These findings indicate clinically meaningful improvement in sleep quality ",
  "following mindfulness meditation(>3 point reduction is clinically significant)."
))
Interpretation Blueprint

Significant improvement in sleep quality: Mdn_pre = 12 vs. Mdn_post = 9, W = 137, p < .001, r = .58 (large). Median reduction of 3.5 PSQI points exceeds clinical significance threshold (3 points). Non-normal differences justified nonparametric test. Supports mindfulness meditation as effective intervention for insomnia.

05Tactical Pivots

Alternatives

Structured fallback pathways for choosing alternative tests when normality or slopes requirements fail.

When the path is blocked, pivot. Rigor is not rigidity; it is the intelligent adaptation to reality.
Adaptive Strategy
Measurement Precision Ladder Ideal · Ordinal / Ranked Delta
Ratio
Consider Paired T-Test if deltas are normal. Ranks discard the clinical magnitude of internal change.
Precision Leak
Interval
Maintain Wilcoxon. Ideal for Pre-Post Scales with heavy tails or influential outliers.
Standard Robustness
Ordinal
Maintain logic. The definitive engine for auditing internal rank-shift within participants.
Peak Signal
Nominal
Abandon ranks. Use McNemar's Test to model binary 'Status Flips' across thresholds.
Identity Loss
Temporal Trajectory Audit Longitudinal Paired Status
Paired
Exactly 2 stages.
Stay with Wilcoxon Signed-Rank. Isolate the drivers of internal categorical change.
Multi-Temporal
3+ timepoints.
Pivot to Friedman Test to audit the consistency of rank-recovery across the study window.
Adaptive Technical Safeguards · adaptive safeguards
asymmetric differences
  • Sign Test — Pivot to purely directional forensics if the symmetry of change is completely unknown.
  • Bootstrapped Paired Strike — Generate robust CIs for the median shift using 1,000 resamples.
normal differences detected
  • Paired T-Test — Return to the most parsimonious model for mean-based discovery.
high missing data
  • Linear Mixed Models (LMM) — Use Maximum Likelihood to preserve participants with incomplete paired strings.
06Adjusted Comparisons

Post-hoc

Group mean comparisons and correction controls (e.g. Tukey HSD, Bonferroni) to protect against Family-Wise Error Rates.

The omnibus test opens the door; post-hoc analysis explores the room.
Forensic Detail
Adjusted Comparisons

Post-hoc pairwise tests defined for this model.

Interpretation Guidelines

Paired rank discovery is about more than just 'Before vs After'. Use the Rank-Biserial 'r' to reveal the unified strength of the participants' internal evolution.

07Standardized scale impact

Effect Size

Understanding effect sizes (e.g., Cohen's d, Partial Eta-Squared) and clinical impact benchmarks.

Significance is noise. Magnitude is the signal. Measure the impact, not just the probability.
Impact Magnitude

Range: -1 to +1. Small: .10, Medium: .30, Large: .50 (Cohen, 1988 adapted). Proportion of favorable pairs minus unfavorable pairs

Range: 0 to 1. Small: .10, Medium: .30, Large: .50 (Cohen, 1988). Calculated as r = |Z|/√n

Robust estimate of location shift. Median of all pairwise averages (xᵢ + xⱼ)/2. Interpretable on original scale with confidence interval

Recommended Metric: matched pairs rank biserial correlation (r_rb) or Hodges-Lehmann estimator with CI
Small
0.2
Medium
0.5
Large
0.8
0.50
matched pairs rank biserial correlation (r_rb) or Hodges-Lehmann estimator with CI
Recommended Measure
4
Available Metrics
ReportUse matched pairs rank biserial correlation (r_rb) or Hodges-Lehmann estimator with CI to represent clinical impact magnitude.
08Statistical Power

Sample Size

Guidelines for minimum sample requirements and power analysis parameters.

An underpowered study is an ethical failure. Respect the data by collecting enough of it.
Power Protocol
Floor Requirements

The 'Sign-Stability' Minimum: A minimum of 15 pairs is essential. Non-parametric paired math requires enough 'Directional Flips' to distinguish a recovery signal from random noise.

Effect SizeParametersRequired n
Small Effectd=0.20 (Small)n ≈ 220 pairs
Medium Effectd=0.50 (Medium)n ≈ 38 pairs
Large Effectd=0.80 (Large)n ≈ 17 pairs
Key considerations

Zero-Difference Strike: Participants who show exactly 0 change are often discarded by the signed-rank algorithm. If you expect a high 'Plateau Rate', increase your recruitment by 20% to maintain your effective N.

G*Power StrategyBenchmark: T-tests → Means: Wilcoxon signed-rank (matched pairs). Parameters: Cohen's d (equivalent), α = .05, Power = .80. The 'Paired Advantage': Like the t-test, this model exploits within-person correlation to maximize signal.
09APA narrative blueprint

Reporting

How to compile statistical results into publication prose matching APA and journal style guides.

Data does not speak for itself. It requires a translator. Be clear, be precise, be honest.
Narrative Arc
Reusable template

A Wilcoxon signed-rank test was conducted to compare condition 1 and condition 2 on outcome measure. State assumption checks: 'Differences were approximately symmetric (skewness = X.XX)' or 'Differences showed asymmetry, so test interpreted as stochastic dominance'. State zero differences: 'X pairs with zero difference were excluded, yielding effective n = XX'. There was a significant/non-significant difference between condition 1 (Mdn = X.XX, IQR = X.XX) and condition 2 (Mdn = X.XX, IQR = X.XX), Z = X.XX, p = .XXX, r = .XX interpret: small/medium/large effect, 95% CI for median difference X.XX, X.XX. Conclude with interpretation in research context.

Essential statistics to report
  • Test statistic (W or Z)
  • p-value
  • Effect size (rank biserial correlation or r = Z/√n)
  • Medians and IQRs for both conditions
  • Effective sample size (after excluding zero differences)
  • Confidence interval for median difference (Hodges-Lehmann estimator)
  • Statement about symmetry assumption
10Exhibit Builder

Manuscript Lab

Copy standard summary tables and forensic reporting grids to outline analysis details.

Table 1: Wilcoxon Signed-Rank Test for Paired Non-Normal Data
ComparisonMedian_diffPositive RanksNegative Rankszpr (Effect Size)
Post - Pre8.542 (Sum: 1120)8 (Sum: 155)-4.52< .001.64
Note. N = 50. Analysis of Pre vs. Post rankings. Significant skewness in difference scores.
42 vs 8 RanksVisualizes the Directional Shift. The overwhelming dominance of positive ranks proves the treatment's effect is systematic.
Header glossary

The 'Improvers'. The number of subjects whose scores increased. 42 out of 50 indicates a highly consistent improvement.

The Matching Strength. .64 is a 'Large' non-parametric effect, proving the shift is robust and widespread across the sample.

11Algorithmic Logic

Command Center

Syntax libraries and function parameters for executing calculations in stats packages.

Code is the modern laboratory. Clean execution ensures reproducible discovery.
Execution Engine
# 1. Execute Wilcoxon Signed-Rank Test
wilcox.test(df$pre, df$post, paired = TRUE, exact = FALSE)

# 2. Extract Effect Size (r)
rstatix::wilcox_effsize(df, score ~ time, paired = TRUE)
Library stack
R
statsrstatix
Python
scipy.statspingouin
Elite Forensic Strike

Unlike the Paired T-test, Wilcoxon is resistant to outliers in the difference scores. If one person had a massive gain, it won't distort the result like it would in a T-test.

# Execute Symmetry Audit (Assumption for testing medians)
# Test if the distribution of difference scores is symmetric.
12The Over-adjustment Trap

Common Mistakes

Analytical caveats and corrections to maintain modeling integrity.

Wisdom is learning from the failures of others. Anticipate the error before it occurs.
Defensive Logic
Why it's wrong
Wilcoxon ONLY tests medians when differences are symmetrically distributed. With skewed differences, it tests stochastic dominance (whether distribution of differences is shifted from zero), not specifically medians. This is analogous to how Mann-Whitney tests distributions, not medians, unless shapes are similar (Divine et al., 2018). The null hypothesis is 'differences are symmetrically distributed around zero', NOT 'median difference is zero' (except when symmetry holds).
The correction
ALWAYS check symmetry of differences (histogram, skewness statistic). If |skewness| < 0.5: interpret as median test. If |skewness| > 1.0: report as 'stochastic dominance' (e.g., 'post-intervention values tend to be lower than pre-intervention'). For explicit median test with skewed data, use Sign test (tests P(+) = P(-)) or quantile regression at 50th percentile. Reference one_way_anova.json common mistake #7 for parallel issue with Kruskal-Wallis.
Why it's wrong
If differences are normally distributed (Shapiro-Wilk p > .05), paired t-test is more powerful (higher statistical power to detect true effects). Wilcoxon has ~95% efficiency relative to t-test for normal data, meaning it requires ~5% larger sample for same power. Using Wilcoxon unnecessarily reduces power.
The correction
ALWAYS test normality of differences first (Shapiro-Wilk, Q-Q plot). If p > .05 (normal) → use paired t-test (more powerful). If p < .05 (non-normal) → use Wilcoxon. Report: 'Wilcoxon was used because differences violated normality assumption (Shapiro-Wilk p = .XXX)'.
Why it's wrong
Wilcoxon signed-rank test requires PAIRED observations (pre-post, matched pairs, within-subjects). For independent groups, the paired structure is violated, and test is invalid. This confuses Wilcoxon signed-rank (paired) with Mann-Whitney U/Wilcoxon rank-sum (independent).
The correction
Verify study design: paired (repeated measures, matched pairs) vs. independent groups. If paired → Wilcoxon signed-rank. If independent → Mann-Whitney U (also called Wilcoxon rank-sum, confusingly). Always specify: wilcox.test(x, y, paired=TRUE) in R or scipy.stats.wilcoxon() for paired in Python.
Why it's wrong
Zero differences (no change from Time1 to Time2) are automatically excluded from Wilcoxon analysis, reducing effective sample size. Failing to report this: (1) inflates apparent sample size, (2) hides potential measurement issues (e.g., many zeros suggest floor/ceiling effects or insensitive measure).
The correction
Always count and report zero differences: 'X pairs with zero difference were excluded from analysis, yielding effective n = Y'. If >20% zeros, investigate measurement sensitivity. Report in Methods: 'Wilcoxon signed-rank test (n = X after excluding Y zero differences)'. High zeros may indicate need for different outcome measure.
Why it's wrong
Wilcoxon uses BOTH direction and magnitude of differences (signed ranks). Sign test uses only direction (+/-). Treating Wilcoxon as only testing direction wastes information and reduces power. Wilcoxon is more powerful when differences have meaningful magnitudes.
The correction
Ensure measurement scale allows meaningful difference magnitudes. For interval/ratio scales (e.g., pain VAS 0-100), Wilcoxon is appropriate. For purely ordinal data where intervals are unequal (e.g., Likert 1-5 with unclear spacing), consider whether magnitude ranking is meaningful or if Sign test (direction only) is more appropriate.
Why it's wrong
p-value indicates statistical significance but not practical importance. With large n, trivial effects can be 'significant'. Effect size quantifies magnitude: is the difference meaningful? Essential for meta-analysis, replication, and clinical significance assessment.
The correction
ALWAYS report effect size: rank biserial correlation (r_rb, preferred), Wilcoxon r (r = Z/√n), or Hodges-Lehmann estimator with CI. Interpret: |r| = .10 (small), .30 (medium), .50 (large). Example: 'Z = -3.45, p < .001, r = .51 (large effect), 95% CI for median difference [-5.2, -2.8]'.
Why it's wrong
Wilcoxon is for exactly 2 paired measurements. For 3+ time points (e.g., pre, mid, post), multiple pairwise Wilcoxon tests inflate Type I error (familywise error rate). With 3 timepoints (3 comparisons), error rate ≈ 1-(1-.05)³ = 14%, not 5%.
The correction
For 3+ repeated measures: use Friedman test (nonparametric ANOVA for repeated measures) + post-hoc tests (Nemenyi or Conover with adjustment). Only use pairwise Wilcoxon if Friedman is significant AND apply Bonferroni/Holm correction (adjusted α = .05/k comparisons). Never run multiple Wilcoxon tests without adjustment.
Why it's wrong
Despite both being called 'Wilcoxon test', they are different: Wilcoxon signed-rank = PAIRED data (pre-post, matched). Wilcoxon rank-sum = Mann-Whitney U = INDEPENDENT groups. Using wrong test invalidates results. This naming confusion causes frequent errors.
The correction
Clarify test name in reporting: 'Wilcoxon signed-rank test for paired samples' (NOT just 'Wilcoxon test'). In software: R wilcox.test(paired=TRUE) = signed-rank; wilcox.test(paired=FALSE) = rank-sum. Python: scipy.stats.wilcoxon() = signed-rank; scipy.stats.mannwhitneyu() = rank-sum. Always verify paired vs. independent design.
13Academic Lineage

References

Scholarly lineage and citation keys grounding the statistical framework.

We stand on the shoulders of giants. Honor the source of the method.
Academic Lineage
[1]
Wilcoxon, F. (1945). Individual comparisons by ranking methods. Biometrics Bulletin, 1(6), 80-83.
Original paper introducing the signed-rank test for paired samples. Foundation for nonparametric paired comparisons.
doi: 10.2307/3001968
[2]
Divine, G. W., Norton, H. J., Barón, A. E., & Juarez-Colunga, E. (2018). The Wilcoxon–Mann–Whitney procedure fails as a test of medians. The American Statistician, 72(3), 278-286.
Critical paper clarifying that Wilcoxon/Mann-Whitney tests distributions (stochastic dominance), NOT medians, unless distribution shapes are similar. Analogous issue applies to Wilcoxon signed-rank: only tests median of differences when differences are symmetric. Essential reading for correct interpretation.
doi: 10.1080/00031305.2017.1305291
[3]
Gong, H., Ni, C., Shen, X., Wu, T., & Jiang, C. (2016). Yoga for prenatal depression: A systematic review and meta-analysis. BMC Psychiatry, 16, 259.
Meta-analysis showing mindfulness/yoga improves sleep quality (PSQI reduction 3-4 points, d = 0.7). Basis for Example 1 effect sizes.
doi: 10.1186/s12888-016-0971-6
[4]
Büssing, A., Ostermann, T., Lüdtke, R., & Michalsen, A. (2012). Effects of yoga interventions on pain and pain-associated disability: A meta-analysis. The Journal of Pain, 13(1), 1-9.
Meta-analysis: yoga reduces chronic pain (VAS reduction 15-20mm, d = 0.6). Basis for Example 2 effect sizes.
doi: 10.1016/j.jpain.2011.10.001
[5]
Kerby, D. S. (2014). The simple difference formula: An approach to teaching nonparametric correlation. Comprehensive Psychology, 3, 11.IT.3.1.
Explains rank biserial correlation as effect size for Wilcoxon tests. Formula: r_rb = (favorable pairs - unfavorable pairs) / total pairs. Interpretable as proportion of favorable comparisons.
doi: 10.2466/11.IT.3.1
A participant is their own best benchmark. If they improve, the rank will find it, even if the scale is broken or the outliers are many.
The Interpretive Rigor Directive
statminds · WilcoxonMind reference · v2.2 · updated 2026-01-1715 of 15 sections