# Count deaths per arm.
event_count(
adsl,
patient = "USUBJID",
treat = "ARM",
label = "Total number of deaths",
.filters = "DTHFL == 'Y'"
)[[1]]
# Count patients withdraw from study due to an adverse event.
withdrawn_lbl <- "Total number of patients withdrawn from study due to an AE"
event_count(
adsl,
patient = "USUBJID",
treat = "ARM",
label = withdrawn_lbl,
.filters = "DCSREAS == 'ADVERSE EVENT'"
)[[1]]
# Count patients with at least one adverse event.
# NB: When `.filters` is `NULL` (i.e., omitted), all records in `dt` are used
# for counting events.
event_count(
adae,
patient = "USUBJID",
treat = "ARM",
label = "Total number of patients with at least one AE",
.filters = "ANL01FL == 'Y'",
.total_dt = adsl
)[[1]]
Run the code above in your browser using DataLab