Calculates N, mean, standard deviation, and a two-sided confidence interval for the mean of a numeric vector.
calc_stats(x, conf_level = 0.95, decimal_places = 2)A list with statistics: n, mean, mean_ci_lwr, mean_ci_upr, median, sd.
x <- c(10, 20, 40, NA, 30)
calc_stats(x, conf_level = 0.95, decimal_places = 2)
#> $n
#> [1] 4
#>
#> $mean
#> [1] 25
#>
#> $mean_ci
#> [1] "4.46 45.54"
#>
#> $mean_ci_lwr
#> [1] 4.46
#>
#> $mean_ci_upr
#> [1] 45.54
#>
#> $median
#> [1] 25
#>
#> $sd
#> [1] 12.90994
#>