library(dplyr)
data <- teal_data()
data <- within(data, {
ADSL <- tmc_ex_adsl
ADRS <- tmc_ex_adrs %>%
filter(PARAMCD %in% c("BESRSPI", "INVET"))
})
join_keys(data) <- default_cdisc_join_keys[names(data)]
ADSL <- data[["ADSL"]]
ADRS <- data[["ADRS"]]
arm_ref_comp <- list(
ACTARMCD = 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_logistic(
label = "Logistic Regression",
dataname = "ADRS",
arm_var = choices_selected(
choices = variable_choices(ADRS, c("ARM", "ARMCD")),
selected = "ARM"
),
arm_ref_comp = arm_ref_comp,
paramcd = choices_selected(
choices = value_choices(ADRS, "PARAMCD", "PARAM"),
selected = "BESRSPI"
),
cov_var = choices_selected(
choices = c("SEX", "AGE", "BMRKR1", "BMRKR2"),
selected = "SEX"
)
)
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}
Run the code above in your browser using DataLab