This test provides a nonparametric alternative to the paired t-test when the differences between paired observations may not follow a normal distribution. It evaluates whether the median of the paired differences is zero. Typical applications include before-and-after measurements on the same subjects, matched samples in medical trials, or any scenario where observations naturally form pairs.
Given pairs , compute the differences . Exclude any pairs where the difference is zero. Rank the absolute values of the remaining differences from smallest to largest, assigning average ranks to ties. Attach the sign of each difference to its rank to obtain signed ranks.
Let be the sum of the positive signed ranks and be the absolute sum of the negative signed ranks. The test statistic is the smaller of these two sums. For sample sizes above about ten, can be approximated by a normal distribution with mean and variance . For smaller samples, exact critical values are typically consulted.
The text area accepts lines like 5,7
or 3.2,2.8
. Each line represents a pair. The script parses these pairs, discards zeros, computes absolute differences, sorts them with their original signs, and assigns ranks. It then sums the positive and negative signed ranks, reports the smaller as , and uses the normal approximation to compute a z-score and p-value. This approach is adequate for educational purposes, though exact tables would be more accurate for very small samples.
A small p-value (for instance below 0.05) indicates evidence against the null hypothesis that the median difference is zero. Because the test uses ranks, it is less sensitive to outliers than the paired t-test. If your data contain large deviations or heavy tails, the Wilcoxon test can provide a more robust assessment of whether an intervention or treatment produces a consistent shift.
Frank Wilcoxon introduced this signed-rank test in 1945 as a refinement over the simpler sign test. By incorporating the magnitude information of differences through ranking, it achieves greater statistical power while remaining nonparametric. Over the decades, it has become a staple in medicine, psychology, and other fields that rely on paired observations.
When differences contain many zeros, the test loses power because those pairs are discarded. Also remember that the normal approximation assumes all ranks are independent, which may not hold for extremely small samples or data with many ties. In such cases, consult exact tables or permutation methods. As always, good graphical analysis of the differences complements the formal test.
To deepen your understanding, compute the test for several datasets and compare the results to the paired t-test. Observe how the test statistic changes when you swap the order of each pair or add small noise. Explore the connection between this test and the Mann-Whitney U test, which handles unpaired samples.
Imagine measuring blood pressure before and after a new medication on the same group of patients. By entering the before-and-after values into this calculator, you can quickly gauge whether the medication consistently lowers blood pressure. Because the test focuses on median differences, it remains informative even if a few patients respond atypically.
The simplest paired test is the sign test, which counts the number of positive and negative differences. While easy to compute, it ignores the magnitude of those differences. The Wilcoxon signed-rank test retains this information through ranking, providing greater sensitivity when effects are subtle. Applying both tests to your data often reveals that the Wilcoxon test produces a smaller p-value, reflecting its greater statistical power.
Today the Wilcoxon signed-rank test appears in virtually all statistical software packages. Its ability to handle small samples without strict distributional assumptions makes it invaluable for disciplines ranging from psychology to engineering. Learning how to perform the test manually fosters a deeper appreciation of nonparametric methods and their place in modern data analysis.
Compute a weighted moving average of a numeric series for forecasting and trend analysis.
Discover how your sun sign pairs with another using this zodiac compatibility calculator. Learn about the elements and qualities that influence astrological relationships.
Determine your eligibility for Hong Kong's Quality Migrant Admission Scheme with our QMAS Points Calculator. Calculate points for age, education, experience, language skills, and more.