aboutsummaryrefslogtreecommitdiff
path: root/util.R
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2016-08-22 12:06:48 -0300
committerSamuel Fadel <samuelfadel@gmail.com>2016-08-22 12:06:48 -0300
commit2e1e2a153a2d193b1de1d3fe23f5f821fe8c56a1 (patch)
treec8150837a55b8525299dedfb36a9b31bd43048a0 /util.R
parent609f5a8bd986b043e5a41088e4ebb7ba8c4b059a (diff)
plot.R: added confidence interval plots.
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)
+}