View source: R/tbl_hierarchical_rate_and_count.R
tbl_hierarchical_rate_and_count | R Documentation |
A mix of adverse event rates (from gtsummary::tbl_hierarchical()
) and counts
(from gtsummary::tbl_hierarchical_count()
).
The function produces additional summary rows for the higher level nesting
variables providing both rates and counts.
When a hierarchical summary is filtered, the summary rows no longer provide
useful/consistent information.
When creating a filtered summary, use gtsummary::tbl_hierarchical()
or
gtsummary::tbl_hierarchical_count()
directly, followed by a call to
gtsummary::filter_hierarchical()
.
tbl_hierarchical_rate_and_count(
data,
variables,
denominator,
by = NULL,
id = "USUBJID",
digits = NULL,
sort = NULL,
label_overall_rate = "Total number of participants with at least one adverse event",
label_overall_count = "Overall total number of events",
label_rate = "Total number of participants with at least one adverse event",
label_count = "Total number of events"
)
## S3 method for class 'tbl_hierarchical_rate_and_count'
add_overall(
x,
last = FALSE,
col_label = "All Participants \n(N = {style_number(N)})",
...
)
data |
( |
variables |
( Variables must be specified in the nesting order. |
denominator |
( |
by |
( |
id |
( |
digits |
( |
sort |
Optional arguments passed to |
label_overall_rate |
( |
label_overall_count |
( |
label_rate |
( |
label_count |
( |
x |
( |
last |
(scalar |
col_label |
( |
... |
These dots are for future extensions and must be empty. |
a gtsummary table
# Example 1 ----------------------------------
cards::ADAE[c(1, 2, 3, 8, 16), ] |>
tbl_hierarchical_rate_and_count(
variables = c(AEBODSYS, AEDECOD),
denominator = cards::ADSL,
by = TRTA
) |>
add_overall(last = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.