library(dplyr)
data <- teal_data()
data <- within(data, {
ADSL <- tmc_ex_adsl
ADRS <- tmc_ex_adrs %>%
mutate(
AVALC = d_onco_rsp_label(AVALC) %>%
with_label("Character Result/Finding")
) %>%
filter(PARAMCD != "OVRINV" | AVISIT == "FOLLOW UP")
})
join_keys(data) <- default_cdisc_join_keys[names(data)]
ADSL <- data[["ADSL"]]
ADRS <- data[["ADRS"]]
arm_ref_comp <- list(
ARMCD = list(ref = "ARM B", comp = c("ARM A", "ARM C")),
ARM = list(ref = "B: Placebo", comp = c("A: Drug X", "C: Combination"))
)
app <- init(
data = data,
modules = modules(
tm_t_binary_outcome(
label = "Responders",
dataname = "ADRS",
paramcd = choices_selected(
choices = value_choices(ADRS, "PARAMCD", "PARAM"),
selected = "BESRSPI"
),
arm_var = choices_selected(
choices = variable_choices(ADRS, c("ARM", "ARMCD", "ACTARMCD")),
selected = "ARM"
),
arm_ref_comp = arm_ref_comp,
strata_var = choices_selected(
choices = variable_choices(ADRS, c("SEX", "BMRKR2", "RACE")),
selected = "RACE"
),
default_responses = list(
BESRSPI = list(
rsp = c("Complete Response (CR)", "Partial Response (PR)"),
levels = c(
"Complete Response (CR)", "Partial Response (PR)",
"Stable Disease (SD)", "Progressive Disease (PD)"
)
),
INVET = list(
rsp = c("Stable Disease (SD)", "Not Evaluable (NE)"),
levels = c(
"Complete Response (CR)", "Not Evaluable (NE)", "Partial Response (PR)",
"Progressive Disease (PD)", "Stable Disease (SD)"
)
),
OVRINV = list(
rsp = c("Progressive Disease (PD)", "Stable Disease (SD)"),
levels = c("Progressive Disease (PD)", "Stable Disease (SD)", "Not Evaluable (NE)")
)
)
)
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}
Run the code above in your browser using DataLab