ard_hierarchical {cards} | R Documentation |
Hierarchical ARD Statistics
Description
Functions ard_hierarchical()
and ard_hierarchical_count()
are primarily helper
functions for ard_stack_hierarchical()
and ard_stack_hierarchical_count()
,
meaning that it will be rare a user needs to call
ard_hierarchical()
/ard_hierarchical_count()
directly.
Performs hierarchical or nested tabulations, e.g. tabulates AE terms nested within AE system organ class.
-
ard_hierarchical()
includes summaries for the last variable listed in thevariables
argument, nested within the other variables included. -
ard_hierarchical_count()
includes summaries for all variables listed in thevariables
argument each summary nested within the preceding variables, e.g.variables=c(AESOC, AEDECOD)
summarizesAEDECOD
nested inAESOC
, and also summarizes the counts ofAESOC
.
Usage
ard_hierarchical(data, ...)
ard_hierarchical_count(data, ...)
## S3 method for class 'data.frame'
ard_hierarchical(
data,
variables,
by = dplyr::group_vars(data),
statistic = everything() ~ c("n", "N", "p"),
denominator = NULL,
fmt_fun = NULL,
stat_label = everything() ~ default_stat_labels(),
id = NULL,
fmt_fn = deprecated(),
...
)
## S3 method for class 'data.frame'
ard_hierarchical_count(
data,
variables,
by = dplyr::group_vars(data),
fmt_fun = NULL,
stat_label = everything() ~ default_stat_labels(),
fmt_fn = deprecated(),
...
)
Arguments
data |
( |
... |
Arguments passed to methods. |
variables |
( |
by |
( |
statistic |
( |
denominator |
(
|
fmt_fun |
( |
stat_label |
( |
id |
( |
fmt_fn |
Value
an ARD data frame of class 'card'
Examples
ard_hierarchical(
data = ADAE |>
dplyr::slice_tail(n = 1L, by = c(USUBJID, TRTA, AESOC, AEDECOD)),
variables = c(AESOC, AEDECOD),
by = TRTA,
id = USUBJID,
denominator = ADSL
)
ard_hierarchical_count(
data = ADAE,
variables = c(AESOC, AEDECOD),
by = TRTA
)