|
15 | 15 | #' @param interpretation Logical. TRUE if the function returns text helping |
16 | 16 | #' to interpret the result, FALSE (default option) to returns only the p-value |
17 | 17 | #' @return Either a p-value (numeric, scalar) or a list containing the p-value and text containing an interpretation |
| 18 | +#' @examples |
| 19 | +#' # Equal probability, 2 kinds of evidence |
| 20 | +#' find_p_two_types(obs_support = 7, total_obs = 10) |
| 21 | +#' # Equal probability, 2 kinds of evidence with interpretation printed |
| 22 | +#' find_p_two_types(obs_support = 7, total_obs = 10, interpretation = TRUE) |
| 23 | +#' # Unequal probability, 2 kinds of evidence with interpretation printed |
| 24 | +#' find_p_two_types(obs_support = 7, total_obs = 10, interpretation = TRUE, odds = .5) |
| 25 | +#' find_p_two_types(obs_support = 7, total_obs = 10, interpretation = TRUE, odds = 2) |
| 26 | +#' # Equal probability, Unequal evidentiary weight, 2 kinds of evidence |
| 27 | +#' find_p_two_types(obs_support = 7, total_obs = 10, weights = rep(1, 7), interpretation = TRUE, odds = 1) |
| 28 | +#' find_p_two_types(obs_support = 7, total_obs = 10, weights = rep(c(2, 1), c(1, 7 - 1)), interpretation = TRUE, odds = 1) |
18 | 29 | #' @export |
19 | 30 | find_p_two_types <- function(obs_support, total_obs, odds = 1, weights = NULL, interpretation = FALSE) { |
20 | 31 | if (is.null(weights)) { |
@@ -45,15 +56,3 @@ find_p_two_types <- function(obs_support, total_obs, odds = 1, weights = NULL, i |
45 | 56 | return(list(thep = thep, interp = interp)) |
46 | 57 | } |
47 | 58 | } |
48 | | -#' @examples |
49 | | -#' ... |
50 | | -#' # Equal probability, 2 kinds of evidence |
51 | | -#' find_p_two_types(obs_support = 7, total_obs = 10) |
52 | | -#' # Equal probability, 2 kinds of evidence with interpretation printed |
53 | | -#' find_p_two_types(obs_support = 7, total_obs = 10, interpretation = TRUE) |
54 | | -#' # Unequal probability, 2 kinds of evidence with interpretation printed |
55 | | -#' find_p_two_types(obs_support = 7, total_obs = 10, interpretation = TRUE, odds = .5) |
56 | | -#' find_p_two_types(obs_support = 7, total_obs = 10, interpretation = TRUE, odds = 2) |
57 | | -#' # Equal probability, Unequal evidentiary weight, 2 kinds of evidence |
58 | | -#' find_p_two_types(obs_support = 7, total_obs = 10, weights = rep(1, 7), interpretation = TRUE, odds = 1) |
59 | | -#' find_p_two_types(obs_support = 7, total_obs = 10, weights = rep(c(2, 1), c(1, 7 - 1)), interpretation = TRUE, odds = 1) |
0 commit comments