Median Test
What is the median test?
The median test is a nonparametric hypothesis test that compares two or more independent samples. You would use this test if the normality assumption of your one-way ANOVA or two-samplet-test is not valid.
The median test replaces the data with a 1 or 0, depending on if the data are above or below the overall median. It essentially counts the number of data values above the median. As an example, say you have the following data: 8, 3, 0, 0, 5, 2, 0, 4, 50, 0. The median is 2.5. Replacing each data value with a 1 if the value is above the median or a 0 if the value is below the median gives the values: 1, 0, 0, 0, 1, 0, 0, 1, 1, 0. There are four values above the median and six values below the median.
Example of the median test
Suppose you are interested in knowing if the distribution of particle counts is the same for each furnace at a deposition operation in semiconductor manufacturing. Five furnaces will be compared in the study. The number of particles is measured for 10 runs per furnace. The data are shown in the table below.
| DEP1 | DEP2 | DEP3 | DEP4 | DEP5 |
| 8 | 15 | 26 | 0 | 1 |
| 3 | 25 | 6 | 26 | 44 |
| 0 | 111 | 0 | 42 | 0 |
| 0 | 27 | 36 | 4 | 12 |
| 5 | 46 | 38 | 0 | 5 |
| 2 | 3 | 25 | 0 | 25 |
| 0 | 48 | 27 | 1 | 43 |
| 4 | 59 | 7 | 4 | 3 |
| 50 | 201 | 5 | 16 | 0 |
| 0 | 0 | 156 | 24 | 0 |
A graph of the data shows particle counts for each furnace.
A normal quantile plot of the data for each furnace shows evidence of non-normality within each group. If the data were normally distributed, we would expect to see the points fall randomly above or below the red diagonal lines. Instead, the points are above the line at the left and right, and below the line in the center (C-shaped pattern). This pattern is consistent with skewed data, which makes sense for particle counts since they have a lower limit at zero.
The overall median of these data is 6.5. The median test on the number of points above the overall median shows a weakly significant difference among the groups, with a p-value of 0.0517.