The Median test investigates the difference between the medians of two independent samples of sizes
${n}_{1}$ and
${n}_{2}$, denoted by:
The hypothesis under test,
${H}_{0}$, often called the null hypothesis, is that the medians are the same, and this is to be tested against the alternative hypothesis
${H}_{1}$ that they are different.
The test proceeds by forming a
$2\times 2$ frequency table, giving the number of scores in each sample above and below the median of the pooled sample:

Sample 1 
Sample 2 
Total 
Scores $\le $ pooled median 
${i}_{1}$ 
${i}_{2}$ 
${i}_{1}+{i}_{2}$ 
Scores $\ge $ pooled median 
${n}_{1}{i}_{1}$ 
${n}_{2}{i}_{2}$ 
$n\left({i}_{1}+{i}_{2}\right)$ 
Total 
${n}_{1}$ 
${n}_{2}$ 
$n$ 
The probability returned should be accurate enough for practical use.
This example is taken from page 112 of
Siegel (1956). The data relate to scores of ‘oral socialisation anxiety’ in 39 societies, which can be separated into groups of size 16 and 23 on the basis of their attitudes to illness.