lyt <- basic_table() %>%
split_cols_by("ARM") %>%
add_colcounts() %>%
count_values(
"STUDYID",
values = "AB12345",
.stats = "count",
.labels = c(count = "Total AEs")
) %>%
count_patients_with_event(
"SUBJID",
filters = c("TRTEMFL" = "Y"),
.labels = c(count_fraction = "Total number of patients with at least one adverse event"),
table_names = "tbl_all"
) %>%
count_patients_with_event(
"SUBJID",
filters = c("TRTEMFL" = "Y", "AEOUT" = "FATAL"),
.labels = c(count_fraction = "Total number of patients with fatal AEs"),
table_names = "tbl_fatal"
) %>%
count_patients_with_event(
"SUBJID",
filters = c("TRTEMFL" = "Y", "AEOUT" = "FATAL", "AEREL" = "Y"),
.labels = c(count_fraction = "Total number of patients with related fatal AEs"),
.indent_mods = c(count_fraction = 2L),
table_names = "tbl_rel_fatal"
)
build_table(lyt, tern_ex_adae, alt_counts_df = tern_ex_adsl)
s_count_patients_with_event(
tern_ex_adae,
.var = "SUBJID",
filters = c("TRTEMFL" = "Y"),
)
s_count_patients_with_event(
tern_ex_adae,
.var = "SUBJID",
filters = c("TRTEMFL" = "Y", "AEOUT" = "FATAL")
)
s_count_patients_with_event(
tern_ex_adae,
.var = "SUBJID",
filters = c("TRTEMFL" = "Y", "AEOUT" = "FATAL"),
denom = "N_col",
.N_col = 456
)
a_count_patients_with_event(
tern_ex_adae,
.var = "SUBJID",
filters = c("TRTEMFL" = "Y"),
.N_col = 100,
.N_row = 100
)
Run the code above in your browser using DataLab