library(dplyr)
data <- teal_data()
data <- within(data, {
ADSL <- tmc_ex_adsl
ADQS <- tmc_ex_adqs %>%
filter(ABLFL != "Y" & ABLFL2 != "Y") %>%
mutate(
AVISIT = as.factor(AVISIT),
AVISITN = rank(AVISITN) %>%
as.factor() %>%
as.numeric() %>%
as.factor(),
AVALBIN = AVAL < 50 # Just as an example to get a binary endpoint.
) %>%
droplevels()
})
datanames <- c("ADSL", "ADQS")
datanames(data) <- datanames
join_keys(data) <- default_cdisc_join_keys[datanames]
app <- init(
data = data,
modules = modules(
tm_a_gee(
label = "GEE",
dataname = "ADQS",
aval_var = choices_selected("AVALBIN", fixed = TRUE),
id_var = choices_selected(c("USUBJID", "SUBJID"), "USUBJID"),
arm_var = choices_selected(c("ARM", "ARMCD"), "ARM"),
visit_var = choices_selected(c("AVISIT", "AVISITN"), "AVISIT"),
paramcd = choices_selected(
choices = value_choices(data[["ADQS"]], "PARAMCD", "PARAM"),
selected = "FKSI-FWB"
),
cov_var = choices_selected(c("BASE", "AGE", "SEX", "BASE:AVISIT"), NULL)
)
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}
Run the code above in your browser using DataLab