Learn R Programming

cards (version 0.5.1)

ard_strata: Stratified ARD

Description

General function for calculating ARD results within subgroups.

While the examples below show use with other functions from the cards package, this function would primarily be used with the statistical functions in the cardx functions.

Usage

ard_strata(.data, .by = NULL, .strata = NULL, .f, ...)

Value

an ARD data frame of class 'card'

Arguments

.data

(data.frame)
a data frame

.by, .strata

(tidy-select)
columns to tabulate by/stratify by for calculation. Arguments are similar, but with an important distinction:

.by: results are tabulated by all combinations of the columns specified, including unobserved combinations and unobserved factor levels.

.strata: results are tabulated by all observed combinations of the columns specified.

These argument should not include any columns that appear in the .f argument.

.f

(function, formula)
a function or a formula that can be coerced to a function with rlang::as_function() (similar to purrr::map(.f))

...

Additional arguments passed on to the .f function.

Examples

Run this code
ard_strata(
  ADSL,
  .by = ARM,
  .f = ~ ard_continuous(.x, variables = AGE)
)

Run the code above in your browser using DataLab