aboutsummaryrefslogtreecommitdiff
path: root/util.R
diff options
context:
space:
mode:
Diffstat (limited to 'util.R')
-rw-r--r--util.R9
1 files changed, 9 insertions, 0 deletions
diff --git a/util.R b/util.R
index 0a87079..3f1a9b8 100644
--- a/util.R
+++ b/util.R
@@ -13,3 +13,12 @@ dir.create.safe <- function(path, log=T) {
dir.create(path)
}
}
+
+# Confidence interval stat summary
+ci.fun <- function(d) {
+ test <- t.test(d)
+ ci <- test$conf.int
+ m <- as.double(test$estimate)
+
+ data.frame(ymin=ci[1], ymax=ci[2], y=m)
+}