Hypothesis testing for difference in medians vs. median difference I found this post saying that one should test for the median difference instead of the difference in medians, in particular if the data is skewed: http://onbiostatistics.blogspot.com/2015/12/median-of-differences-versus-difference.html The authors says "median of differences is the correct number to be used and is the number that corresponding to the signed rank test". 
I did not find good explanations for this. My question: are there any reasons from a statistical perspective why the median difference should be preferred over the difference in medians?
To give some more background: The differences are paired. Moreover, the paired differences are highly skewed to the right (in my real data set), which is why I want to use a bootstrap hypothesis test.

Example
Suppose I have a two samples x1 and x2 as below. The samples are paired, for instance the id could specify the person and x1 could be a measurement before intervention and x2 after the intervention (for the same person).
id    x1      x2    difference
1   1.37    1.68    -0.31   
2   2.18    2.99    -0.80   
3   1.16    3.24    -2.07   
4   3.60    3.08    0.52    
5   2.33    2.19    0.13    

The median difference would be: median(x1 - x2) = median(difference) = -0.31
The difference in medians would be: median(x1) - median(x2) = -0.80.
 A: Data. There are some minor discrepancies (maybe from rounding) in your data table.
The table below is what I get from inputting your x1 and x2. These are
the values I will use:
       x1   x2     d
[1,] 1.37 1.68 -0.31
[2,] 2.18 2.99 -0.81
[3,] 1.16 3.24 -2.08
[4,] 3.60 3.08  0.52
[5,] 2.33 2.19  0.14

Sample means and medians behave differently. The reason there needs to be a discussion here is that sample means and
sample medians behave in substantially different ways.
Means: If $D_i = X_{1i} - X_{2i},$ then $\bar D = \bar X_1 - \bar X_2,$ where bars designate sample means.
Medians: However, as for your data, one may have $\tilde D \ne \tilde X_1 - \tilde X_2,$ where tildes designate sample medians.
Paired Wilcoxon test. The point made in your link is that the paired Wilcoxon test is a essentially a one-sample signed-rank test on differences. 
Thus, you get the same results from the following two tests involving
 medians. (I'm using R.)
One-sample Wilcoxon test on differences.
wilcox.test(d)

    Wilcoxon signed rank test

data:  d
V = 4, p-value = 0.4375
alternative hypothesis: true location is not equal to 0

Paired Wilcoxon test.
wilcox.test(x1, x2, paired=T)  # computes differences first

        Wilcoxon signed rank test

data:  x1 and x2
V = 4, p-value = 0.4375
alternative hypothesis: true location shift is not equal to 0

Incorrect procedure:  If you forget the parameter 'paired=T' in the paired
test, then R does a Mann-Whitney-Wilcoxon (rank-sum) two-sample test.
The P-value is not enormously different, but it should be clear that the
test below is not the paired test.
wilcox.test(x1, x2)  # TWO-sample test, NOT PAIRED

        Wilcoxon rank sum test

data:  x1 and x2
W = 8, p-value = 0.4206
alternative hypothesis: true location shift is not equal to 0

Graphical presentation of paired data. For much the same reasons, if you want to show a boxplot for paired data,
you must make a single boxplot of differences (as at left), not two separate boxplots of for Before and After. (In showing boxplots, I am assuming that your actual data have more than five subjects. It is unusual to make boxplots of as few as five observations.)

Confusion results from making separate stripcharts (dotplots) of scores Before and After because the plot does not show which Before values are paired with which After values.

You might try connecting data points to show pairs.

Note: For only five subjects, as in the data you show in your Question, the nonparametric Wilcoxon signed rank test would not show a significant result unless all five differences have the same sign.
