Putting your data into R as vectors q1
and q4
:
q1 = c(6, 19.5, 5.1, 4.7, 10.6)
q4 = c(6, 5, 2.5, 2.1, 5.4)
Your paired Wilcoxon test gives the following results:
wilcox.test(q1, q4, pair=T) # 2-sided is default
Wilcoxon signed rank test with
continuity correction
data: q1 and q4
V = 10, p-value = 0.1003
alternative hypothesis:
true location shift is not equal to 0
Warning message:
In wilcox.test.default(q1, q2, pair = T) :
cannot compute exact p-value with zeroes
Now find the five paired differences.
d = q1 - q4; d
[1] 0.0 14.5 2.6 2.6 5.2
wilcox.test(d) # 2-sided test with 0 null is default
Wilcoxon signed rank test
with continuity correction
data: d
V = 10, p-value = 0.1003
alternative hypothesis:
true location is not equal to 0
Warning message:
In wilcox.test.default(d) :
cannot compute exact p-value with zeroes
The result is exactly the same as for the 'paired' test.
The paired test begins by finding the paired
differences and then doing the one-sample Wilcoxon signed-rank
test on the differences (instead of the two-sample Wilcoxon rank sum test on the two samples, as if indepencent).
Notes: (1) Additional evidence.
Taken separately, there are no ties in your
two columns of data. So you might have wondered about
the Warning message for the 'paired' test.
However, upon taking differences,
you do have a a $0$ difference and a tie (at 2.6) for two out of the five differences.
(2) Neither the $0$ nor the tie is the reason one fails to get significant results
at the 5% level--for just the five subjects you list as examples.
The following simulation
repeatedly jitters the data very slightly to avoid $0$ and to break ties. None of the
jittered data give significant results at the 5% level:
pv = replicate(10^4, wilcox.test(
d+runif(5, -.001,.001))$p.val)
summary(pv)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.06250 0.06250 0.06250 0.09354 0.12500 0.12500
Also, with only five subjects the smallest possible P-value for a one-sided test is $1/32$ and the smallest for a 2-sided test is $1/16 = 0.0625,$ achieved as the min
in the simulation.
(3) The data seem to be numerical (instead of merely ordinal). Even if we assume differences are normal (and with only $n=5$ of them, there's no use trying to test that), a paired t test comes nowhere near significance
at the 5% level, partly because of a large variance.
t.test(d)$p.val
[1] 0.1191081