3

If I only know the medians and IQRs from samples (along with the number of samples of each population) drawn from two distributions, how to test the medians of the two distributions are different or not?

t-test is based on mean and sd. But I don't find a test based on median and IQR. Is there such a statistical test?

user1424739
  • 424
  • 2
  • 9
  • "..along with number of samples of each population..." Did you mean sample size of each sample? Is your sample size large? – Dayne Feb 16 '22 at 04:17
  • Yes. As n1 and n2 in t-test https://en.wikipedia.org/wiki/Student%27s_t-test#Equal_or_unequal_sample_sizes,_unequal_variances_(sX1_%3E_2sX2_or_sX2_%3E_2sX1). They could be large or small, but not very small. – user1424739 Feb 16 '22 at 04:24
  • The problem is that if you do not have large sample, you should know (or at least be able to make reasonable assumptions) about the underlying distribution of the population. And then derive the *sampling* distribution of an appropriate statistic which is a function of sample median. If the sample is large, however, and asymptotic distribution will make your life easy. See [this](https://stats.stackexchange.com/questions/45124/central-limit-theorem-for-sample-medians) for more. – Dayne Feb 16 '22 at 04:36
  • For non-parametric tests, see this: https://en.wikipedia.org/wiki/Median_test – Dayne Feb 16 '22 at 04:38
  • A solution can be separated into two cases: large samples and small samples. Since large sample case may be easier, a partial solution for this case may be offered first. – user1424739 Feb 16 '22 at 04:57
  • The non-parametric tests you can perform directly on statistics of this sort are analyzed in my post at https://stats.stackexchange.com/a/87096/919. It would help to have the actual quartiles rather than just the IQR, though. Even when you don't, you at least know that *one* of the quartiles is no closer to the median than half the IQR. You can run with that. – whuber Feb 17 '22 at 17:14

2 Answers2

4

If the parent distributions are normal, then the $t$-statistic $$t = \frac{\text{Mean}_1 - \text{Mean}_2}{\sqrt{\dfrac{s_1^2}{N_1}+\dfrac{s_2^2}{N_2}}}$$ has the same distribution as $$u = \frac{\text{Median}_1 - \text{Median}_2}{\sqrt{\pi/2}\,\sqrt{J_1+J_2}}$$ where $$J_1=\frac{IQR_1^2}{1.82 N_1}, \ \ J_2 = \frac{IQR_2^2}{1.82 N_2}$$ This is because the variances of sample medians are $\pi/2$ times the variances of sample means, and the IQRs are $\sqrt{1.82^{\phantom'}}$ times the standard deviations.

So if the populations are normal or roughly normal, you can apply the $t$-test to $u$, using $$\nu=\frac{(J_1+J_2)^2}{\dfrac{J_1^2}{N_1-1} + \dfrac{J_2^2}{N_2 -1}}$$ degrees of freedom.

This follows Welch's $t$-test, and when the variances or sample sizes are equal, the formulas can also be simplified to follow Student’s $t$-test.

Matt F.
  • 1,656
  • 4
  • 20
-1

Non-parametric tests, like Mann-Whitney, assign numeric ranks to all the observations in the groups, then test whether the sums of ranks in the groups are different. So, AFAIK, we cannot conduct a non-parametric test just by knowing the median+IQR.

maaniB
  • 242
  • 1
  • 5
  • The first part of the answer is not asked in the question. I am only interested in a solution using medians and IQRs. If such a solution is not available, I will need a proof that it is not possible to create a test using just medians and IQRs. – user1424739 Feb 16 '22 at 04:56
  • 1
    This answer is logically flawed: just because *some* nonparametric tests use ranks and not all ranks are available does not imply a non-parametric test is impossible. Indeed, there is an obvious such test lying on the table: compare the statistics you do have. That is analyzed at https://stats.stackexchange.com/questions/86931. – whuber Feb 17 '22 at 17:12
  • Thanks, @whuber. I had not read such non-rank methods in the mainstream statistical books. As I understood, such tests can be used under some minor assumptions that these robust statistics or 5-letter summaries are from F distribution, and the sample sizes are known, right? – maaniB Feb 19 '22 at 10:13
  • This is unrelated to the F distribution. – whuber Feb 19 '22 at 18:51