The Median test is a chi-squared test with fixed marginal totals. It tests whether several samples came from populations with the same median. The null hypothesis is that all samples have the same median.
- The data distribution differs significantly from the normal distribution.
- The measurement scale of the dependent variable is ordinal (not interval or ratio).
- The data sample is too small.
Each unique set of values in the groupby columns is called a group-by value set, or GBV set. The function does a separate Median test for each unique GBV set, testing whether all populations have the same median. Output for each GBV is a p-value, which you can compare to the specified threshold to determine whether to reject the null hypothesis for the GBV. For more than 2 samples, the Median test is sometimes called the Brown-Mood test.
The Median test is less powerful than Rank Tests because the dependent variable is dichotomized at the median. Dichotomizing the dependent variable at the median tends to discard most of the information inherent in the data. Frequencies are evaluated by a 2x2 contingency table, so it becomes a 2x2 chi-squared test of independence with one degree of freedom.