Utility to perform pairwise comparisons.
Arguments
- data
(
data.frame
)
a data frame- variable
(
tidy-select
)
Column to perform pairwise analyses for.- .f
(
function
)
a function that creates ARDs. The function accepts a single argument and a subset ofdata
will be passed including the two levels ofvariable
for the pairwise analysis.- include
(
vector
)
a vector of levels of thevariable
column to include in comparisons. Pairwise comparisons will only be performed for pairs that have a level specified here. Default isNULL
and all pairwise computations are included.
Examples
ard_pairwise(
ADSL,
variable = ARM,
.f = \(df) {
ard_complex(
df,
variables = AGE,
statistic = ~ list(ttest = \(x, data, ...) t.test(x ~ data$ARM)[c("statistic", "p.value")])
)
},
include = "Placebo" # only include comparisons to the "Placebo" group
)
#> $`'Placebo' vs. 'Xanomeline High Dose'`
#> {cards} data frame: 2 x 8
#> variable context stat_name stat_label stat fmt_fn
#> 1 AGE complex statistic statistic 0.655 1
#> 2 AGE complex p.value p.value 0.513 1
#> ℹ 2 more variables: warning, error
#>
#> $`'Placebo' vs. 'Xanomeline Low Dose'`
#> {cards} data frame: 2 x 8
#> variable context stat_name stat_label stat fmt_fn
#> 1 AGE complex statistic statistic -0.353 1
#> 2 AGE complex p.value p.value 0.724 1
#> ℹ 2 more variables: warning, error
#>