library(dplyr)
anl <- tern_ex_adsl %>%
distinct(STUDYID, USUBJID, ARM) %>%
mutate(
PARAMCD = "TNDOSMIS",
PARAM = "Total number of missed doses during study",
AVAL = sample(0:20, size = nrow(tern_ex_adsl), replace = TRUE),
AVALC = ""
)
basic_table() %>%
split_cols_by("ARM") %>%
add_colcounts() %>%
count_missed_doses("AVAL", thresholds = c(1, 5, 10, 15), var_labels = "Missed Doses") %>%
build_table(anl, alt_counts_df = tern_ex_adsl)
Run the code above in your browser using DataLab