# Hodges-Lehmann shift in cumulative score (drug - vehicle) with its 95% CI, from R's wilcox.test
# (normal approximation with ties, as in analysis.R). R 4.3.3, base R.
d <- read.csv("scores.csv")
cum <- aggregate(score ~ mouse + group, data = d, sum)
w <- wilcox.test(score ~ factor(group, levels = c("drug", "vehicle")), data = cum, conf.int = TRUE, exact = FALSE)
cat(sprintf("Hodges-Lehmann shift (drug - vehicle): %.1f, 95%% CI %.1f to %.1f, p = %.4f\n", w$estimate, w$conf.int[1], w$conf.int[2], w$p.value))
