dot-format_wilcoxtest_results: Convert Wilcoxon test to ARD

.format_wilcoxtest_resultsR Documentation

Convert Wilcoxon test to ARD

Description

Convert Wilcoxon test to ARD

Usage

.format_wilcoxtest_results(by = NULL, variable, lst_tidy, paired, ...)

Arguments

by

(string)
by column name

variable

(string)
variable column name

lst_tidy

(named list)
list of tidied results constructed with eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$am) |> broom::tidy()).

paired

a logical indicating whether you want a paired test.

...

passed to stats::wilcox.test(...)

Value

ARD data frame

Examples


# Pre-processing ADSL to have grouping factor (ARM here) with 2 levels
ADSL <- cards::ADSL |>
  dplyr::filter(ARM %in% c("Placebo", "Xanomeline High Dose")) |>
  ard_stats_wilcox_test(by = "ARM", variables = "AGE")

cardx:::.format_wilcoxtest_results(
  by = "ARM",
  variable = "AGE",
  paired = FALSE,
  lst_tidy =
    cards::eval_capture_conditions(
      stats::wilcox.test(ADSL[["AGE"]] ~ ADSL[["ARM"]], paired = FALSE) |>
        broom::tidy()
    )
)


cardx documentation built on Sept. 11, 2024, 9:12 p.m.