Mood’s Median Test

Introduction

For completeness, we now present another non-parametric replacement for one-way ANOVA, namely Mood’s Median Test. This test is essentially an extension of the Sign Test to two or more variables. We have already described this test for two independent variables in Mood’s Median Test for Two Samples.

The Kruskal-Wallis test has more power and is preferred to Mood’s Median Test since it takes into account the ranking of data whereas Mood’s Median Test just takes into account whether a data element is larger or smaller than the median.

Example

Example 1: Repeat Example 1 of Kruskal-Wallis Test using Mood’s Median Test.

The approach, as shown in Figure 1, is exactly the same as that described in Mood’s Median Test for Two Samples where we have one column in the contingency table for each independent variable.

Moo'd Median Test Excel

Figure 1 – Mood’s Median Test

We see that the p-value = 0.100196 > .05 = α, and so the null hypothesis is not refuted. We conclude there is no significant difference between the three creams being tested. This is different from the result obtained from Kruskal-Wallis.

Worksheet Functions

Real Statistics Functions: The Real Statistics Pack provides the following functions:

MOODS_STAT(R1) = the chi-square test statistic for Mood’s Median test where R1 contains the sample data.

MOODS_TEST(R1) = the p-value statistic for Mood’s Median test where R1 contains the sample data.

As we can see from Figure 1, χ2 = MOODS_STAT(A4:C13) = 4.60125 and p-value = MOODS_TEST(A4:C13) = 0.100196.

Examples Workbook

Click here to download the Excel workbook with the examples described on this webpage.

Reference

Scott, R. (2019) Understanding the uses for Mood’s median test
https://processnews.blogspot.com/2019/10/understanding-uses-moods-median-test.html

12 thoughts on “Mood’s Median Test”

  1. I’m not surprised – neither Mann-Whitney nor Kruskal-Wallis are tests of medians and both can fail miserably at this, unless strong assumptions hold:
    1) both samples are IID: same dispersion, same shape (if skewed, then in the same direction) – tests pseudomedian change
    2) both samples are symmetric around the medians tests median difference.
    If the two assumptions don’t hold, you simply cannot, by no mean, attribute the difference to medians, because this test is sensitive to multiple things.
    Even worse, rank based tests assess pseudomedian difference, which is NOT difference of medians (unlike means).
    So I would first check the Brunner-Munzel, which accounts *partially* for different dispersions and validate it with quantile regression.
    But never I would trust here Mann-Whitney (Wilcoxon) or Kruskal-Wallis unless the variances are same and shapes are same.
    For rich literature set (free access) and examples I made please check: https://gist.github.com/adrianolszewski/2cec75678e1183e4703589bfd22fa8b2

    Reply
  2. Example 1 here (Mood’s) results in p=0.100 (no significant difference). The same Example 1 for Kruskal-Wallis results in p=0.012 (significant difference). The box plot comparisons (Figure 2 in Kruskal-Wallis) show overlapping whiskers, but IQR for “New” doesn’t overlap IQR for “Old” and “Control” so I’m inclined to believe the Kruskal-Wallis result.

    Comments? Under what circumstances would you prefer one test over the other when they show a difference like this?

    Reply
        • Yes, you are 100% right. All rank-based methods (including ATS – ANOVA-Type Statistic, WTS = Wald’s Type Statistic, ART ANOVA, Conover’s ANOVA-on-ranks, and they older brothers: Mann-Whitney, Kruskal-Wallis, Friedman, Brunner-Munzel) will compare samples but in a “general way”, I mean – they can be sensitive to differences in locations (including medians), dispersions (alone; when both medians are exactly equal, as in my simulations) and shapes. Then it’s similar to CDF-comparing methods, like Anderson-Darling, Cramer-von Mises or their oldest brother – Kolmogorov-Smirnov, which look at the CDF distance, but not specifically on a concrete parameter. One needs to decide what’s the research hypothesis. Sometimes we want to focus on location shift, sometimes we care about the dispersions, sometimes about the shape (if observations concentrate towards smaller or larger values, if multiple modes diminish, and so on), and sometimes – all together. Then rank-based tests are perfect. Though quantile regression, performed at several quartiles (say, minimum=q0, q1, median=q2, q3, maximum=q4) may provide more informative answer. But when our goal is to focus on comparing means or medians, applying these tests without the additional assumptions will test a different hypothesis: stochastic superiority, which is much, much more general. And then no surprise that for med1=med2 p-value may go below 0.00000001 if dispersions or shapes (not only skewness, also kurtosis, modes) vary a lot.

          Reply
  3. Hello, I was really excited when I came across this, unfortunately, in MS Excel with office 365 even with the AnalyzePak add-on I don’t seem to have neither the MOODS_STAT nor the MOODS_TEST functions anymore. I tried using the function wizard to find its replacement, but don’t seem to find any. I am missing something obvious?

    Reply

Leave a Comment