Solved – How to test if the mean equals the median

hypothesis testingmeanmedian

Suppose you wish to test the hypothesis that the mean of a distribution equals the median, given some samples drawn from the distribution. How would this be done? I am guessing that the test statistic would be (the absolute value of) the sample mean minus the sample median, but am not sure about the standard error of that statistic (the sample mean and median are not independent, I believe). Is this a well known test?

Best Answer

This is a bootstrap confidence interval for the (median - mean) difference in R:

z = function() {s = sample(women$weight, replace=TRUE); median(s)-mean(s)}
k = replicate(10000, z())
c(quantile(k, c(.025, .5, .975)), mean=mean(k), sd=sd(k), qgte0=mean(k>=0))

     2.5%       50%     97.5%      mean        sd     qgte0 
-7.933333 -1.333333  5.800000 -1.218007  3.513462  0.362100 

I'm still pondering if the mean and SD of the k resample of the difference could be used in a Wald(-like) test, or if the quantile greater than or equal to 0 can be viewed as a one-sided p value under some assumptions — comments on this are welcome.