R/mean_ci.R

Defines functions mean_ci

Documented in mean_ci

#' @title Compute confidence interval around mean using normal approximation
#' @param x
mean_ci <- function(x, conf = 0.95) {
  se <- sd(x) / sqrt(length(x))
  alpha <- 1 - conf
  mean(x) + se * qnorm(c(alpha / 2, 1 - alpha / 2))
}
jenniferzj/DSTools documentation built on May 25, 2019, 6:23 p.m.