7
$\begingroup$

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?

$\endgroup$
3
  • 3
    $\begingroup$ Do you have a specific alternative hypothesis in mind? Note, too, that comparing the mean to the median (in some way) often shows up as a test of skewness: that's a good way to search the literature. Check out the recent paper in JSE that shows up as a top hit: Investigating the Investigative Task: Testing for Skewness / An Investigation of Different Test Statistics and their Power to Detect Skewness It reports some simulation results of several tests. $\endgroup$
    – whuber
    Commented Apr 16, 2011 at 20:14
  • $\begingroup$ @whuber: yes, I am thinking about this as a test of skewness. I recall seeing (sample mean - sample median) / sample standard deviation used some indicator of skewness, with the nice property that it is bound between -/+ 1. As far as the alternative hypothesis, I can go with a one-sided or two sided alternative. $\endgroup$
    – shabbychef
    Commented Apr 16, 2011 at 20:25
  • $\begingroup$ do you have this in mind with a specific model or set of models (some skewed some not skewed) or a non-parametric style test? What will you do if the test comes back "positive" (mean not equal to median)? What will you do if it comes back "negative" or "inconclusive"? $\endgroup$ Commented Apr 17, 2011 at 5:01

2 Answers 2

4
$\begingroup$

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.

$\endgroup$
3
  • 1
    $\begingroup$ Would the one please who downvoted my answer to negative please explain? I believe that confidence intervals can be useful alternatives/supplements to significance tests. So although I know my reply did not give a full answer to the question I believe it has some value. $\endgroup$
    – GaBorgulya
    Commented Apr 18, 2011 at 0:31
  • 1
    $\begingroup$ (+1) Such a confidence interval would be useful and sensible. If a P value was wanted then, rather than using anything parametric, I would suggest a permutations test to give an exact value. (In fact I did suggest it!) $\endgroup$ Commented Apr 18, 2011 at 3:47
  • $\begingroup$ you've encountered the phenomenon of drive-by downvoting:) Do not worry, it happens. Note that sometimes people police their or other questions by downvoting the answers they feel are not apropriate. In general your answer is useful, but in this particular case, I feel the OP wants the some kind of statistical test. The bootstrap might give you an idea, but in this particular case bootstrap is too crude as a solution. $\endgroup$
    – mpiktas
    Commented Apr 18, 2011 at 7:11
0
$\begingroup$

A permutations test can easily be set up to use the (mean - mode difference) as its test statistic. That would give you an exact P value for the difference.

$\endgroup$
5
  • 1
    $\begingroup$ (meadian, not mode - cheers) $\endgroup$
    – Tal Galili
    Commented Apr 18, 2011 at 4:13
  • 1
    $\begingroup$ +1 for the idea, but could you write down the actual test statistic? $\endgroup$
    – mpiktas
    Commented Apr 18, 2011 at 7:11
  • $\begingroup$ Can you elaborate? There are no labels; what would you permute? $\endgroup$
    – lockedoff
    Commented Apr 18, 2011 at 19:32
  • 1
    $\begingroup$ @lockedoff Whoops! I think that your implication is right: there is nothing to permute. I guess I didn't read the question well enough. The nearest thing to what I had in mind that would be possible is the bootstrap approach suggested by GaBogulya. Sorry. $\endgroup$ Commented Apr 18, 2011 at 22:42
  • 1
    $\begingroup$ Makes sense ;) $\endgroup$
    – lockedoff
    Commented Apr 19, 2011 at 14:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.