You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: R/conf_int.R
+30-20Lines changed: 30 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,40 @@
1
-
#' Compute the confidence interval for (currently only) simulation-based methods
1
+
#' Compute confidence interval
2
2
#'
3
-
#' \code{get_confidence_interval()} and \code{get_ci()} are both aliases of \code{conf_int()}
4
-
#' @param x data frame of calculated statistics or containing attributes
5
-
#' of theoretical distribution values. Currently, dependent on statistics being stored in \code{stat} column as created in \code{calculate()} function.
6
-
#' @param level a numerical value between 0 and 1 giving the confidence level. Default value is 0.95.
7
-
#' @param type a string giving which method should be used for creating the confidence interval. The default is \code{"percentile"} with \code{"se"} corresponding to (multiplier * standard error) as the other option.
8
-
#' @param point_estimate a numeric value or a 1x1 data frame set to NULL by default. Needed to be provided if \code{type = "se"}.
3
+
#' Only simulation-based methods are (currently only) supported.
4
+
#' `get_confidence_interval()` and `get_ci()` are both aliases of `conf_int()`.
5
+
#'
6
+
#' @param x Data frame of calculated statistics or containing attributes of
7
+
#' theoretical distribution values. Currently, dependent on statistics being
8
+
#' stored in `stat` column as created in [calculate()] function.
9
+
#' @param level A numerical value between 0 and 1 giving the confidence level.
10
+
#' Default value is 0.95.
11
+
#' @param type A string giving which method should be used for creating the
12
+
#' confidence interval. The default is `"percentile"` with `"se"`
13
+
#' corresponding to (multiplier * standard error) as the other option.
14
+
#' @param point_estimate A numeric value or a 1x1 data frame set to `NULL` by
15
+
#' default. Needed to be provided if `type = "se"`.
9
16
#'
10
-
#' @return a 2 x 1 tibble with values corresponding to lower and upper values in the confidence interval
11
-
#' @export
12
-
#' @rdname get_ci
17
+
#' @return A 1 x 2 tibble with values corresponding to lower and upper values in
18
+
#' the confidence interval.
19
+
#'
13
20
#' @examples
14
21
#' mtcars_df <- mtcars %>%
15
-
#' dplyr::mutate(am = factor(am))
22
+
#' dplyr::mutate(am = factor(am))
16
23
#' d_hat <- mtcars_df %>%
17
-
#' specify(mpg ~ am) %>%
18
-
#' calculate(stat = "diff in means", order = c("1", "0"))
24
+
#' specify(mpg ~ am) %>%
25
+
#' calculate(stat = "diff in means", order = c("1", "0"))
19
26
#' bootstrap_distn <- mtcars_df %>%
20
-
#' specify(mpg ~ am) %>%
21
-
#' generate(reps = 100) %>%
22
-
#' calculate(stat = "diff in means", order = c("1", "0"))
27
+
#' specify(mpg ~ am) %>%
28
+
#' generate(reps = 100) %>%
29
+
#' calculate(stat = "diff in means", order = c("1", "0"))
0 commit comments