A Signed Rank Test of Hypotheses about a Median

The statistic on which this test is based is computed by assigning to each value in the dataset its ranking in the list of the absolute differences multiplied by the sign of (so values below get assigned a negative rank). These signed ranks are then summed to produce . If the null hypothesis is true, that is, if is the median of the distribution from which the sample comes, then the signs of the differences can be regarded as Bernoulli trials. Using this to assign probabilities to all the possible signed rank sums gives the distribution which is shown in blue in the upper image above. The mean of this distribution is zero and its variance is . The purple curve is the density of a normal distribution with this mean and variance, which gives a good approximation to this distribution for all but very small sample sizes.
You can control the mean of the underlying population and the size of this sample with the top two sliders, and you can draw new samples of the same size from the same underlying population with the bottom slider.
The lower image shows the scatterplot of the points with a horizontal line at the point . The degree to which the points in the plot are above or below this line is evidence for the median of the underlying distribution being above or below .


  • [Snapshot]
  • [Snapshot]
  • [Snapshot]


The fact that the signs of the values can be regarded as independent Bernoulli random variables can serve as the basis of a sign test of the hypothesis . An objection to such a test is that it fails to account for the magnitudes of the differences . Signed rank tests like the one above address this objection. Some tests—generally called "Wilcoxon Signed Rank Tests"—use the statistic obtained by summing only those absolute values for which the difference is positive or negative. These two statistics together with the statistic used in this Demonstration are referred to in various places as "Wilcoxon statistics". These tests can be used to assess the statistical evidence for one variable being larger than another by using the data and taking .


    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.

Mathematica »
The #1 tool for creating Demonstrations
and anything technical.
Wolfram|Alpha »
Explore anything with the first
computational knowledge engine.
MathWorld »
The web's most extensive
mathematics resource.
Course Assistant Apps »
An app for every course—
right in the palm of your hand.
Wolfram Blog »
Read our views on math,
science, and technology.
Computable Document Format »
The format that makes Demonstrations
(and any information) easy to share and
interact with.
STEM Initiative »
Programs & resources for
educators, schools & students.
Computerbasedmath.org »
Join the initiative for modernizing
math education.
Step-by-Step Solutions »
Walk through homework problems one step at a time, with hints to help along the way.
Wolfram Problem Generator »
Unlimited random practice problems and answers with built-in step-by-step solutions. Practice online or make a printable study sheet.
Wolfram Language »
Knowledge-based programming for everyone.
Powered by Wolfram Mathematica © 2018 Wolfram Demonstrations Project & Contributors  |  Terms of Use  |  Privacy Policy  |  RSS Give us your feedback
Note: To run this Demonstration you need Mathematica 7+ or the free Mathematica Player 7EX
Download or upgrade to Mathematica Player 7EX
I already have Mathematica Player or Mathematica 7+