# How to obtain the confidence interval for the median and for the difference in median between two groups without having the individual data

With two samples A and B having nA and nB as size, muA and muB as means and sigmaA and sigmaB as standard deviations I can calculate the 95% confidence interval of each mean, but also the confidence interval of the difference between the means.

Could I do the same when the estimator is the median? That is, summary data Med A and Med B for the respective medians, and Q1A and Q1B for first quartiles and Q3A and Q3B for the third quartiles and I also have the sizes of the samples nA and nB. Is there a formula (from these summary) allowing me to calculate the confidence intervals of the two medians but also that of their difference? Or could I estimate it by bootstrap (with R preferably)?

• Can we make any distribution assumptions such as normal distributions? Then yes. Otherwise no. Then again, why would people publish a median they had a normality assumption. Sep 7, 2022 at 16:46
• The answers are no, no, and no. See stats.stackexchange.com/questions/45124 for analysis and insight.
– whuber
Sep 7, 2022 at 20:37

Anscombe’s quartet is useful here, to show that you can’t calculate anything substantial about medians from that data. These four datasets’ differences of medians, and the medians themselves, are all different even though they all have the same means and standard deviations and correlation. R gives the medians readily with apply(anscombe, 2, median):
  x1   x2   x3   x4   y1   y2   y3   y4