This module produces a table to summarize analysis of variance, consistent with the TLG Catalog
template for AOVT01
available here when multiple
endpoints are selected.
Usage
tm_t_ancova(
label,
dataname,
parentname = ifelse(inherits(arm_var, "data_extract_spec"),
teal.transform::datanames_input(arm_var), "ADSL"),
arm_var,
arm_ref_comp = NULL,
aval_var,
cov_var,
include_interact = FALSE,
interact_var = NULL,
interact_y = FALSE,
avisit,
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 toADSL
.- arm_var
(
teal.transform::choices_selected()
)
object with all available choices and preselected option for variable names that can be used asarm_var
. It defines the grouping variable in the results table.- arm_ref_comp
(
list
) optional,
if specified it must be a named list with each element corresponding to an arm variable inADSL
and the element must be another list (possibly with delayedteal.transform::variable_choices()
or delayedteal.transform::value_choices()
with the elements namedref
andcomp
that the defined the default reference and comparison arms when the arm variable is changed.- aval_var
(
teal.transform::choices_selected()
)
object with all available choices and pre-selected option for the analysis variable.- cov_var
(
teal.transform::choices_selected()
)
object with all available choices and preselected option for the covariates variables.- include_interact
(
logical
)
whether an interaction term should be included in the model.- interact_var
(
character
)
name of the variable that should have interactions with arm. If the interaction is not needed, the default option isNULL
.- interact_y
(
character
)
a selected item from the interact_var column which will be used to select the specificANCOVA
results when interact_var is discrete. If the interaction is not needed, the default option isFALSE
.- avisit
(
teal.transform::choices_selected()
)
value of analysis visitAVISIT
of interest.- paramcd
(
teal.transform::choices_selected()
)
object with all available choices and preselected option for the parameter code variable fromdataname
.- conf_level
(
teal.transform::choices_selected()
)
object with all available choices and pre-selected option for the confidence level, each within range of (0, 1).- pre_output
(
shiny.tag
) optional,
with text placed before the output to put the output into context. For example a title.- post_output
(
shiny.tag
) optional,
with text placed after the output to put the output into context. For example theshiny::helpText()
elements are useful.- basic_table_args
(
basic_table_args
) optional
object created byteal.widgets::basic_table_args()
with settings for the module table. The argument is merged with optionteal.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")
.
Details
When a single endpoint is selected, both unadjusted and adjusted comparison are provided. This modules expects that the analysis data has the following variables:
AVISIT
: variable used to filter for analysis visits.PARAMCD
: variable used to filter for endpoints, after filtering forparamcd
andavisit
, one observation per patient is expected for the analysis to be meaningful.
See also
The TLG Catalog where additional example apps implementing this module can be found.
Examples
data <- teal_data()
data <- within(data, {
ADSL <- tmc_ex_adsl
ADQS <- tmc_ex_adqs
})
join_keys(data) <- default_cdisc_join_keys[names(data)]
ADSL <- data[["ADSL"]]
ADQS <- data[["ADQS"]]
arm_ref_comp <- list(
ARM = list(
ref = "B: Placebo",
comp = c("A: Drug X", "C: Combination")
),
ACTARMCD = list(
ref = "ARM B",
comp = c("ARM A", "ARM C")
)
)
app <- init(
data = data,
modules = modules(
tm_t_ancova(
label = "ANCOVA Table",
dataname = "ADQS",
avisit = choices_selected(
choices = value_choices(ADQS, "AVISIT"),
selected = "WEEK 1 DAY 8"
),
arm_var = choices_selected(
choices = variable_choices(ADSL, c("ARM", "ACTARMCD", "ARMCD")),
selected = "ARMCD"
),
arm_ref_comp = arm_ref_comp,
aval_var = choices_selected(
choices = variable_choices(ADQS, c("CHG", "AVAL")),
selected = "CHG"
),
cov_var = choices_selected(
choices = variable_choices(ADQS, c("BASE", "STRATA1", "SEX")),
selected = "STRATA1"
),
paramcd = choices_selected(
choices = value_choices(ADQS, "PARAMCD", "PARAM"),
selected = "FKSI-FWB"
),
interact_var = choices_selected(
choices = variable_choices(ADQS, c("BASE", "STRATA1", "SEX")),
selected = "STRATA1"
)
)
)
)
#> Initializing tm_t_ancova
#> Initializing reporter_previewer_module
if (interactive()) {
shinyApp(app$ui, app$server)
}