Here is an R
solution applying the $t$-test for paired data.
x = scan()
1: 37.14 33.21
3: 34.69 31.25
5: 65.52 43.73
7: 40.56 38.26
9: 41.32 41.72
11: 39.34 38.14
13: 43.95 41.07
15: 44.26 39.49
17: 35.28 28.50
19: 37.12 32.40
21: 37.82 35.87
23: 34.71 33.79
25: 34.08 30.49
27: 33.08 36.29
29: 36.89 33.18
31: 41.38 37.70
33: 39.29 33.86
35: 41.62 39.21
37: 39.36 35.43
xmat <- matrix(x, ncol=2, byrow = TRUE)
t.test(xmat[,1], xmat[,2], paired = TRUE)
Paired t-test
data: xmat[, 1] and xmat[, 2]
t = 3.4757, df = 18, p-value = 0.002698
alternative hypothesis: true mean difference is not equal to 0
95 percent confidence interval:
1.536795 6.233732
sample estimates:
mean difference
3.885263
And here is another solution based on the Wilcoxon signed-rank test for two paired samples, aka the Mann-Whitney test:
wilcox.test(xmat[,1], xmat[,2], paired = TRUE, conf.int = TRUE,correct = TRUE, )
Wilcoxon signed rank test with continuity correction
data: xmat[, 1] and xmat[, 2]
V = 181, p-value = 0.0005795
alternative hypothesis: true location shift is not equal to 0
95 percent confidence interval:
2.179984 4.350064
sample estimates:
(pseudo)median
3.314607
Warning messages:
1: In wilcox.test.default(xmat[, 1], xmat[, 2], paired = TRUE, conf.int = TRUE, :
cannot compute exact p-value with ties
2: In wilcox.test.default(xmat[, 1], xmat[, 2], paired = TRUE, conf.int = TRUE, :
cannot compute exact confidence interval with ties
The two warning messages you see, as they say it, are due to the presence of ties for which the exact sampling distribution doesn't hold and we have to resort to asymptotic results.
Comment. The two confidence intervals are quite different although I'm not sure if this difference is relevant from a clinical point of view. Nevertheless, presumably this difference may be to the presence of a slight departure from normality shown by QQ-plot applied to the difference between the two variables.
qqnorm(xmat[,1]-xmat[,2])
qqline(xmat[,1]-xmat[,2])
