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 Baseline
A: Drug X 14/134 (10.4%) 8/134 (6.0%)
B: Placebo 11/134 (8.2%) 11/134 (8.2%)
C: Combination 15/132 (11.4%) 14/132 (10.6%)
ALT>3x Baseline
A: Drug X 7/134 (5.2%) 20/134 (14.9%)
B: Placebo 10/134 (7.5%) 9/134 (6.7%)
C: Combination 12/132 (9.1%) 8/132 (6.1%)
AST>3x Baseline or ALT>3x Baseline
A: Drug X 8/134 (6.0%) 22/134 (16.4%)
B: Placebo 19/134 (14.2%) 15/134 (11.2%)
C: Combination 14/132 (10.6%) 13/132 (9.8%)