Skip to content

Commit

Permalink
styler
Browse files Browse the repository at this point in the history
  • Loading branch information
ddsjoberg committed Jul 5, 2024
1 parent 28e4c03 commit c7bca58
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 35 deletions.
42 changes: 21 additions & 21 deletions R/ard_categorical_ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,27 +117,27 @@ ard_categorical_ci.data.frame <- function(data,
~ list(
prop_ci =
switch(method,
"waldcc" = \(x, ...) proportion_ci_wald(x, conf.level = conf.level, correct = TRUE),
"wald" = \(x, ...) proportion_ci_wald(x, conf.level = conf.level, correct = FALSE),
"wilsoncc" = \(x, ...) proportion_ci_wilson(x, conf.level = conf.level, correct = TRUE),
"wilson" = \(x, ...) proportion_ci_wilson(x, conf.level = conf.level, correct = FALSE),
"clopper-pearson" = \(x, ...) proportion_ci_clopper_pearson(x, conf.level = conf.level),
"agresti-coull" = \(x, ...) proportion_ci_agresti_coull(x, conf.level = conf.level),
"jeffreys" = \(x, ...) proportion_ci_jeffreys(x, conf.level = conf.level),
"strat_wilsoncc" = \(x, data, ...) {
proportion_ci_strat_wilson(x,
strata = data[[strata]], weights = weights,
max.iterations = max.iterations,
conf.level = conf.level, correct = TRUE
)
},
"strat_wilson" = \(x, data, ...) {
proportion_ci_strat_wilson(x,
strata = data[[strata]], weights = weights,
max.iterations = max.iterations,
conf.level = conf.level, correct = FALSE
)
}
"waldcc" = \(x, ...) proportion_ci_wald(x, conf.level = conf.level, correct = TRUE),
"wald" = \(x, ...) proportion_ci_wald(x, conf.level = conf.level, correct = FALSE),
"wilsoncc" = \(x, ...) proportion_ci_wilson(x, conf.level = conf.level, correct = TRUE),
"wilson" = \(x, ...) proportion_ci_wilson(x, conf.level = conf.level, correct = FALSE),
"clopper-pearson" = \(x, ...) proportion_ci_clopper_pearson(x, conf.level = conf.level),
"agresti-coull" = \(x, ...) proportion_ci_agresti_coull(x, conf.level = conf.level),
"jeffreys" = \(x, ...) proportion_ci_jeffreys(x, conf.level = conf.level),
"strat_wilsoncc" = \(x, data, ...) {
proportion_ci_strat_wilson(x,
strata = data[[strata]], weights = weights,
max.iterations = max.iterations,
conf.level = conf.level, correct = TRUE
)
},
"strat_wilson" = \(x, data, ...) {
proportion_ci_strat_wilson(x,
strata = data[[strata]], weights = weights,
max.iterations = max.iterations,
conf.level = conf.level, correct = FALSE
)
}
)
)
) |>
Expand Down
6 changes: 3 additions & 3 deletions R/ard_categorical_ci.survey.design.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ ard_categorical_ci.survey.design <- function(data,
conf.level = .env$conf.level,
...
) |>
list(),
list(),
result =
.data$lst_result[["result"]] |>
enframe("stat_name", "stat") |>
list(),
enframe("stat_name", "stat") |>
list(),
warning = .data$lst_result["warning"] |> unname(),
error = .data$lst_result["error"] |> unname(),
context = "survey_categorical_ci"
Expand Down
3 changes: 1 addition & 2 deletions R/ard_continuous_ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ ard_continuous_ci.data.frame <- function(data, variables, by = dplyr::group_vars
method <- arg_match(method)

# calculate CIs --------------------------------------------------------------
switch(
method,
switch(method,
"t.test" =
ard_stats_t_test_onesample(
data = data,
Expand Down
18 changes: 9 additions & 9 deletions R/ard_continuous_ci.survey.design.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
#' ard_continuous_ci(dclus1, variables = api00)
#' ard_continuous_ci(dclus1, variables = api00, method = "svymedian.xlogit")
ard_continuous_ci.survey.design <- function(data,
variables,
by = NULL,
method = c("svymean", "svymedian.mean", "svymedian.beta", "svymedian.xlogit", "svymedian.asin", "svymedian.score"),
conf.level = 0.95,
df = survey::degf(data),
...) {
variables,
by = NULL,
method = c("svymean", "svymedian.mean", "svymedian.beta", "svymedian.xlogit", "svymedian.asin", "svymedian.score"),
conf.level = 0.95,
df = survey::degf(data),
...) {
set_cli_abort_call()

# check inputs ---------------------------------------------------------------
Expand Down Expand Up @@ -127,11 +127,11 @@ ard_continuous_ci.survey.design <- function(data,
conf.level = .env$conf.level,
...
) |>
list(),
list(),
result =
.data$lst_result[["result"]] |>
enframe("stat_name", "stat") |>
list(),
enframe("stat_name", "stat") |>
list(),
warning = .data$lst_result["warning"] |> unname(),
error = .data$lst_result["error"] |> unname(),
context = "survey_continuous_ci"
Expand Down

0 comments on commit c7bca58

Please sign in to comment.