Calculate confidence interval
mm_ci.RdCalculates the confidence interval for the mean of a numeric vector using the t-distribution.
Value
A numeric vector containing the confidence interval bounds:
If
side = "all", returns a vector of length 2:c(lower, upper).If
side = "left"or"right", returns a single numeric value.
Examples
x <- c(10, 12, 11, 14, 13, 15)
mm_ci(x)
#> [1] 10.53669 14.46331
mm_ci(x, alpha = 0.01)
#> [1] 9.4204 15.5796
mm_ci(x, side = "left")
#> [1] 10.53669