The Mood’s Median is a non-parametric hypothesis test the difference of two or more population median.



For run this test it’s important that:

  • All samples are random from the respective population;
  • Works on ordinal data;
  • The distribution of the k samples isn’t normal but have the same shape;
  • The k samples are independent of each other;
  • In each sample, the observation is independent;
  • We have few outlier because in working with median the outlier doesn’t helps.


In this case the hypothesis are like:

  • H0: all the k population median are equal
  • H1at least one of the median are different.


The way to conduct the hypothesis test is like the one-sample t-tests, but we use another statistics.


To compute the statistics first you need to:

  • Put together all the observation from the k sample and find the overall median M – Es: you have S1 = {1,5,7,8} and S2 = {2,4,6} so you have Stot={1,2,4,5,6,7,8} and M=5;
  • In each sample, order the observation (in ascending way) and count how many data point falls above M and how many data point falls on or belove – Es: So you calculate the contigency table1;
S1S2Tot
Belove or On224
Above213
Tot437
table1 – contingency table
  • Now you can perform the Chi-square test based on this data in table1, so for each cell you calculate the expected value as: cell= row tot * column tot / total of total – Es: so you calculate the expected value in table2;
S1S2Tot
Belove or On4*4/7 = 2,284*3/7 = 1,71
Above3*4/7 =1,713*3/7 =1,28
Tot
table2 – expected value table
  • So now Chi-square goodnes of fit test, the formula is in image1
image1 - Chi-square goodness of fit test formula
image1 – Chi-square goodness of fit test formula

In our example the X-square is ((2-2,28)^2)/2,28 + ((2-1,71)^2)/1,71 + ((2-1,71)^2)/1,71 + ((1-1,28)^2)/1,28 = 0,193

The degree of freedom are computed as (2-1)*(2-1) =1 because we assue that each sample have value or above or belove of the median (so 2).

Now we can get the crtical value from the chi square table, with degree of freedom 1, and our alpha (for example 0,05) that is 3,841.

In this example because 0,193< 3,841 we fail to reject H0 with alpha = 0,05.

Share on: