Skip to contents

Teal Module: Teal module for Generalized Estimating Equations (GEE) analysis

Usage

tm_a_gee(
  label,
  dataname,
  parentname = ifelse(inherits(arm_var, "data_extract_spec"),
    teal.transform::datanames_input(arm_var), "ADSL"),
  aval_var,
  id_var,
  arm_var,
  visit_var,
  cov_var,
  arm_ref_comp = NULL,
  paramcd,
  conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order =
    TRUE),
  pre_output = NULL,
  post_output = NULL,
  basic_table_args = teal.widgets::basic_table_args()
)

Arguments

label

(character)
menu item label of the module in the teal app.

dataname

(character)
analysis data used in teal module.

parentname

(character)
parent analysis data used in teal module, usually this refers to ADSL.

aval_var

(choices_selected or data_extract_spec)
object with all available choices and preselected option for the analysis variable.

id_var

(choices_selected or data_extract_spec)
object specifying the variable name for subject id.

arm_var

(choices_selected or data_extract_spec)
object with all available choices and preselected option for variable names that can be used as arm_var. It defines the grouping variable(s) in the results table. If there are two elements selected for arm_var, second variable will be nested under the first variable.

visit_var

(choices_selected or data_extract_spec)
object with all available choices and preselected option for variable names that can be used as visit variable. Must be a factor in dataname.

cov_var

(choices_selected or data_extract_spec)
object with all available choices and preselected option for the covariates variables.

arm_ref_comp

optional, (list)
If specified it must be a named list with each element corresponding to an arm variable in ADSL and the element must be another list (possibly with delayed teal.transform::variable_choices() or delayed teal.transform::value_choices() with the elements named ref and comp that the defined the default reference and comparison arms when the arm variable is changed.

paramcd

(choices_selected or data_extract_spec)
variable value designating the studied parameter.

conf_level

(choices_selected)
object with all available choices and preselected option for the confidence level, each within range of (0, 1).

pre_output

optional, (shiny.tag)
with text placed before the output to put the output into context. For example a title.

post_output

optional, (shiny.tag)
with text placed after the output to put the output into context. For example the shiny::helpText() elements are useful.

basic_table_args

optional, (basic_table_args)
object created by teal.widgets::basic_table_args() with settings for the module table. The argument is merged with option teal.basic_table_args and with default module arguments (hard coded in the module body).

For more details, see the vignette: vignette("custom-basic-table-arguments", package = "teal.widgets").

Examples

adsl <- tmc_ex_adsl
adqs <- tmc_ex_adqs %>%
  dplyr::filter(ABLFL != "Y" & ABLFL2 != "Y") %>%
  dplyr::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()

app <- init(
  data = cdisc_data(
    cdisc_dataset("ADSL", adsl),
    cdisc_dataset("ADQS", adqs)
  ),
  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(adqs, "PARAMCD", "PARAM"),
        selected = "FKSI-FWB"
      ),
      cov_var = choices_selected(c("BASE", "AGE", "SEX", "BASE:AVISIT"), NULL)
    )
  )
)
#> [INFO] 2023-05-31 23:41:24.7655 pid:3043 token:[] teal.modules.clinical Initializing tm_a_gee (prototype)
if (interactive()) {
  shiny::shinyApp(app$ui, app$server)
}