Wikipedia says that we can rewrite the hypotheses of the one-sample Wilcoxon signed-rank test in terms of expected value (as "a test for the location of the mean") if the following assumptions are met (below we have random iid sample $(X_1,\ldots,X_n) \overset{\text{iid}}{\sim} F$):
- $F$ has unique median $\mathrm{med}(X)$ such that $P(X = \mathrm{med}(X)) = 0$;
- $F$ is symmetric about $\mathrm{med}(X)$;
- Expectation $\mathrm{E}[X]$ exists.
So, if these assumptions are met then $\mathrm{med}(X) = \mathrm{E}[X]$ and the hypotheses of the one-sample Wilcoxon signed-rank test are the following (for the two-sided alternative):
$\quad\begin{aligned}H_0: ~\mathrm{med}(X) = 0 \\ H_1: ~\mathrm{med}(X) \neq 0 \end{aligned} \qquad \iff \qquad \begin{aligned}\widetilde{H_0}: ~\mathrm{E}[X] = 0 \\ \widetilde{H_1}: ~\mathrm{E}[X] \neq 0 \end{aligned}$
Next, I tried to use the fact that paired Wilcoxon signed-rank test is just a special case of its one sample version (if we have paired samples $(X_1,\ldots,X_n) \overset{\text{iid}}{\sim} F_1$ and $(Y_1, \ldots, Y_n) \overset{\text{iid}}{\sim} F_2$, we just need to replace $X$ by difference $X - Y$ in the aforementioned formulas), and got the following.
Assumptions for the paired Wilcoxon signed-rank test:
- Distribution of $X - Y$ has unique median $\mathrm{med}(X-Y)$ such that $P(X - Y = \mathrm{med}(X-Y)) = 0$;
- Distribution of $X - Y$ is symmetric about $\mathrm{med}(X-Y)$;
- Expectation $\mathrm{E}[X-Y]$ exists.
If these assumptions are met then $\mathrm{med}(X-Y) = \mathrm{E}[X-Y]$ and the hypotheses of the paired Wilcoxon signed-rank test are the following (for the two-sided alternative):
$\quad\begin{aligned}H_0: ~\mathrm{med}(X-Y) = 0 \\ H_1: ~\mathrm{med}(X-Y) \neq 0 \end{aligned} \qquad \iff \qquad \begin{aligned}\widetilde{H_0}: ~\mathrm{E}[X-Y] = 0 \\ \widetilde{H_1}: ~\mathrm{E}[X-Y] \neq 0 \end{aligned}$
This all seems fine but one thing confuses me: expectation is a linear operator, so we can rewrite $\widetilde{H_0}$ and $\widetilde{H_1}$ as $\widetilde{H_0}: \mathrm{E}[X] = \mathrm{E}[Y]$ and $\widetilde{H_1}: \mathrm{E}[X] \neq \mathrm{E}[Y]$ respectively. But population median is not a linear operator, hence we can't rewrite $H_0$ and $H_1$ as $H_0: \mathrm{med}(X) = \mathrm{med}(Y)$ and $H_1: \mathrm{med}(X) \neq \mathrm{med}(Y)$ respectively.
In other words, paired Wilcoxon signed-rank test (if the aforementioned assumptions are met) is a test for comparing the means of the paired samples, but it is not a test for comparing the medians of the paired samples. Is this conclusion right or wrong?
P.S. There is a post on SSE on similar topic, it claims that paired Wilcoxon signed-rank test can be a test of median difference (or mean difference) only if two fairly strict assumptions are met:
The distribution of both groups must have the same shape.
The variance of both groups must be equal.
These assumptions seem strange for me because, as far as I know, paired Wilcoxon signed-rank test is just a special case of its one-sample version. And I didn't met these two assumptions in other sources (I saw these assumptions in requirements for the Mann–Whitney U test but not for the Wilcoxon signed-rank test).