Suppose that we have 2 sets of data $X = x_1, \dots, x_n$ and $Y = y_1, \dots, y_m$ and a test $T$ that tests the null hypothesis that these data come from a distribution with the same median. $T$ can be for example the Mann-Whitney U test or the Wilcoxon signed rank test (if we have paired data). In programming terms $T$ is a function that takes two samples and returns a p-value $$ p := T(X, Y) $$ Now let us suppose that we want to compare $X$ and $Y$ quantitatively. That is we want to say for example:
On the 5% significance level the median of $X$ is at least 5 times bigger than that of $Y$ but not more than 7 times bigger.
To do this we can test hypotheses for various multiples of $Y$: $$ p(c) := T(X, cY) $$
Then we plot the p-values and get something like this:
For very big and very small values of $c$ the p-value drops to a level determined by the sample size, while somewhere in the middle it will have one connected global maximum. If we select a certain significance level $s$ then the set $I_s$ defined by $$ I_s := \{c\in \mathbb{R} \text{ such that } p(c) > s \} $$ Is an interval $[a; b]$ and we can say that:
On the 5% significance level the median of $X$ is at least $a$ times bigger than that of $Y$ but not more than $b$ times bigger.
But what did we just do? Did we find the confidence interval for the median of $\frac{\textbf{x}}{\textbf{y}}$ where $\textbf{x, y}$ are the underlying random variables? Or is this methodology flawed? Is there such a method somewhere in literature? Is there some better way?