tm_t_ancova | R Documentation |
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.
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(),
transformators = list(),
decorators = list()
)
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 for paramcd
and avisit
, one
observation per patient is expected for the analysis to be meaningful.
a teal_module
object.
This module generates the following objects, which can be modified in place using decorators:
table
(TableTree
- output of rtables::build_table()
)
A Decorator is applied to the specific output using a named list of teal_transform_module
objects.
The name of this list corresponds to the name of the output to which the decorator is applied.
See code snippet below:
tm_t_ancova( ..., # arguments for module decorators = list( table = teal_transform_module(...) # applied only to `table` output ) )
For additional details and examples of decorators, refer to the vignette
vignette("decorate-module-output", package = "teal.modules.clinical")
.
To learn more please refer to the vignette
vignette("transform-module-output", package = "teal")
or the teal::teal_transform_module()
documentation.
The TLG Catalog where additional example apps implementing this module can be found.
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"
)
)
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.