I have the following small dataset, that consists of scores before and after a certain treatment for 15 individuals:
df <- structure(list(before = c(4.1, 4.4, 3.7, 2.6, 4.1, 2, 3.1, 5.9,
2.4, 6.3, 2.3, 2.3, 4.1, 3.3, 4.7), after = c(3.3, 2.3, 3.2,
3.9, 2.4, 3.9, 0.2, 5, 3.7, 2.8, -2.6, 4.2, 2.5, 3, -1.4)), row.names = c(NA,
15L), class = "data.frame")
Classical tests ($t$-test or Wilcoxon test), along with their associated confidence interval, do not bring sufficient evidence against the null hypothesis of no difference:
t.test(df$before, df$after, paired = TRUE)
Paired t-test
data: df$before and df$after
t = 2.0374, df = 14, p-value = 0.06097
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.06640299 2.58640299
wilcox.test(df$before, df$after, paired = TRUE, conf.int = TRUE)
Wilcoxon signed rank exact test
data: df$before and df$after
V = 90, p-value = 0.0946
alternative hypothesis: true location shift is not equal to 0
95 percent confidence interval:
-0.2 2.6
However, a bootstrap approach seems to bring a stronger evidence (if we assume that I have correctly implemented this approach in R), with narrower 95% CI that not include zero:
my_diff <- function(data, indices) {
data <- data[indices, ]
return(mean(data$after - data$before))
}
set.seed(2020)
library(boot)
res <- boot(data = df, statistic = my_diff, R = 999)
boot.ci(res, type = c("bca", "perc"))
BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS
Based on 999 bootstrap replicates
CALL :
boot.ci(boot.out = res, type = c("bca", "perc"))
Intervals :
Level Percentile BCa
95% (-2.380, -0.153 ) (-2.381, -0.155 )
Calculations and Intervals on Original Scale
In the case of my very small sample, which approach should be regarded as the most reliable, or at least well suited to this dataset?
Thanks!