Tabulate Overall Summary
Usage
# S3 method for class 'tbl_ae'
add_overall(x, across = NULL, ...)
# S3 method for class 'tbl_ae_count'
add_overall(x, across = NULL, ...)
# S3 method for class 'tbl_ae_focus'
add_overall(x, across = NULL, ...)
Arguments
- x
Object of class
"tbl_ae"
,"tbl_ae_focus"
, or"tbl_ae_count"
- across
Specify the type of overall statistics to include.
"both"
adds summaries across both theby=
andstrata=
levels"by"
adds summaries across theby=
levels"strata"
adds summaries across thestrata=
levels"overall-only"
adds a single overall column Default is all possible overall types.
- ...
Not used
Notes
If the spanning headers are modified prior to the call of add_overall()
,
the ordering of the columns may not be correct.
Examples
# \donttest{
# Example 1 -----------------------------------------------------------------
add_overall_ex1 <-
df_adverse_events %>%
tbl_ae_count(
ae = adverse_event,
soc = system_organ_class,
by = grade,
strata = trt
) %>%
add_overall() %>%
modify_header(all_ae_cols() ~ "**Grade {by}**") %>%
bold_labels()
# Example 2 -----------------------------------------------------------------
add_overall_ex2 <-
df_adverse_events %>%
tbl_ae(
id = patient_id,
ae = adverse_event,
soc = system_organ_class,
by = grade
) %>%
add_overall(across = 'by') %>%
modify_header(all_ae_cols() ~ "**Grade {by}**") %>%
bold_labels()
# Example 3 -----------------------------------------------------------------
add_overall_ex3 <-
df_adverse_events %>%
tbl_ae_focus(
id = patient_id,
include = c(any_complication, grade3_complication),
ae = adverse_event,
strata = trt
) %>%
add_overall(across = 'strata')
# Example 4 -----------------------------------------------------------------
add_overall_ex4 <-
df_adverse_events %>%
tbl_ae(
id = patient_id,
ae = adverse_event,
soc = system_organ_class,
by = grade,
strata = trt
) %>%
add_overall(across = 'overall-only') %>%
modify_header(all_ae_cols() ~ "**Grade {by}**") %>%
bold_labels()
# }