The One-Sample Wilcoxon Signed-Rank Test is a non-parametric test that determines whether the median of a sample is equal to a specific, hypothesized value. It is the non-parametric equivalent of the one-sample t-test and is used when the data cannot be assumed to be normally distributed.
This test is appropriate when you have a single set of data and want to compare its median to a known standard, target, or theoretical value. For example, you could use it to test if the median pH of a chemical solution is 7.0, or if the median score on a test is different from a national average of 80.
The test works by calculating the differences between each data point and the hypothesized median, ranking the absolute values of these differences, and summing the ranks of the positive and negative differences. The output includes:
Q1: How is the W statistic calculated manually?
The calculation follows these steps:
Q2: What is the difference between the one-sample and paired-sample Wilcoxon tests?
Q3: How is the Z-approximation calculated for this test?
For larger sample sizes (e.g., \(n > 20\)), a normal approximation with a Z-score is used to find the p-value. The Z-score is calculated as:
$$ Z = \frac{W - \mu_W}{\sigma_W} $$Where \(\mu_W\) is the mean and \(\sigma_W\) is the standard deviation of the W distribution:
Q4: What are the null and alternative hypotheses?
The hypotheses test the population median, denoted by \(\eta\), against the hypothesized median, \(\eta_0\):
Using this calculator's default sample data (5.2, 5.5, 4.8, 4.9, 5.9, 6.1, 5.8, 6.5, 4.5, 5.3, 5.7 vs. hypothesized median 5.0), here's how to run the same test elsewhere.
R's wilcox.test() handles the one-sample case directly via the mu argument:
x <- c(5.2, 5.5, 4.8, 4.9, 5.9, 6.1, 5.8, 6.5, 4.5, 5.3, 5.7)
wilcox.test(x, mu = 5.0, correct = TRUE)
scipy.stats.wilcoxon tests differences from zero directly, so subtract the hypothesized median from your data first:
from scipy.stats import wilcoxon
x = [5.2, 5.5, 4.8, 4.9, 5.9, 6.1, 5.8, 6.5, 4.5, 5.3, 5.7]
hypo_median = 5.0
differences = [v - hypo_median for v in x]
stat, p = wilcoxon(differences, mode='approx', correction=True)
print(stat, p)
Analyze → Nonparametric Tests → Legacy Dialogs → 1-Sample Wilcoxon Signed Rank Test isn't a built-in legacy menu item; the standard workaround is Analyze → Nonparametric Tests → One Sample, using the Customize Analysis tab to select the Wilcoxon Signed-Rank test and setting the hypothesized median.
T-Tests → One Sample T-Test. Move your variable into the Variables box, set Test value to your hypothesized median, and under Tests uncheck Student and check Wilcoxon signed-rank instead. JASP outputs the W statistic and p-value directly.