d <- read.csv("before_after.csv")
p <- t.test(d$after, d$before, paired = TRUE); u <- t.test(d$after, d$before)
cat(sprintf("Paired t-test (same mice): mean change = %.2f (95%% CI %.2f to %.2f), t = %.2f, df = %.0f, p = %.4f\n", mean(d$after - d$before), p$conf.int[1], p$conf.int[2], p$statistic, p$parameter, p$p.value))
cat(sprintf("Unpaired Welch t-test (pairing ignored): t = %.2f, df = %.2f, p = %.3f\n", u$statistic, u$parameter, u$p.value))
