Only simulation-based methods are (currently only) supported.
get_confidence_interval()
and get_ci()
are both aliases of conf_int()
.
conf_int(x, level = 0.95, type = "percentile", point_estimate = NULL) get_ci(x, level = 0.95, type = "percentile", point_estimate = NULL) get_confidence_interval(x, level = 0.95, type = "percentile", point_estimate = NULL)
x | Data frame of calculated statistics or containing attributes of
theoretical distribution values. Currently, dependent on statistics being
stored in |
---|---|
level | A numerical value between 0 and 1 giving the confidence level. Default value is 0.95. |
type | A string giving which method should be used for creating the
confidence interval. The default is |
point_estimate | A numeric value or a 1x1 data frame set to |
A 1 x 2 tibble with values corresponding to lower and upper values in the confidence interval.
mtcars_df <- mtcars %>% dplyr::mutate(am = factor(am)) d_hat <- mtcars_df %>% specify(mpg ~ am) %>% calculate(stat = "diff in means", order = c("1", "0")) bootstrap_distn <- mtcars_df %>% specify(mpg ~ am) %>% generate(reps = 100) %>% calculate(stat = "diff in means", order = c("1", "0")) bootstrap_distn %>% conf_int(level = 0.9)#> # A tibble: 1 x 2 #> `5%` `95%` #> <dbl> <dbl> #> 1 4.27 10.1bootstrap_distn %>% conf_int(type = "se", point_estimate = d_hat)#> # A tibble: 1 x 2 #> lower upper #> <dbl> <dbl> #> 1 3.56 10.9