Learn R Programming

gtreg (version 0.4.1)

add_overall_tbl_ae: Tabulate Overall Summary

Description

Tabulate Overall Summary

Usage

# S3 method for tbl_ae
add_overall(x, across = NULL, ...)

# S3 method for tbl_ae_count add_overall(x, across = NULL, ...)

# S3 method for tbl_ae_focus add_overall(x, across = NULL, ...)

Value

Summary object of same input class

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 the by= and strata= levels

  • "by" adds summaries across the by= levels

  • "strata" adds summaries across the strata= 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.

Example Output

Example 1

Example 2

Example 3

Example 4

Examples

Run this code
# \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()
# }

Run the code above in your browser using DataLab