Code
result <- basic_table() %>%
split_cols_by("TITLE") %>%
split_cols_by("APERIODC") %>%
split_rows_by("PARAM") %>%
split_rows_by("ACTARM", split_fun = drop_split_levels, child_labels = "hidden") %>%
count_occurrences("ARM_AVALC", .stats = "fraction", denom = "n", drop = TRUE) %>%
build_table(anl)
criteria_fun <- function(tr) {
row_label <- obj_label(tr)
dplyr::if_else(row_label == "Criteria not met", TRUE, FALSE)
}
result <- result %>% trim_rows(criteria = criteria_fun)
result
First Elevated Result Occurring During
PERIOD 1 PERIOD 2
——————————————————————————————————————————————————————————————————————
AST >3x ULN
A: Drug X 11/134 (8.2%) 21/134 (15.7%)
B: Placebo 17/134 (12.7%) 16/134 (11.9%)
C: Combination 10/132 (7.6%) 8/132 (6.1%)
ALT >3x ULN
A: Drug X 14/134 (10.4%) 8/134 (6.0%)
B: Placebo 24/134 (17.9%) 18/134 (13.4%)
C: Combination 16/132 (12.1%) 10/132 (7.6%)
AST >3x ULN or ALT >x3 ULN
A: Drug X 14/134 (10.4%) 15/134 (11.2%)
B: Placebo 8/134 (6.0%) 13/134 (9.7%)
C: Combination 11/132 (8.3%) 12/132 (9.1%)