This module produces an analysis table using Generalized Estimating Equations (GEE).
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(),
decorators = NULL
)
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
.- aval_var
(
teal.transform::choices_selected()
)
object with all available choices and pre-selected option for the analysis variable.- id_var
(
teal.transform::choices_selected()
)
object specifying the variable name for subject id.- 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.- visit_var
(
teal.transform::choices_selected()
)
object with all available choices and preselected option for variable names that can be used asvisit
variable. Must be a factor indataname
.- cov_var
(
teal.transform::choices_selected()
)
object with all available choices and preselected option for the covariates variables.- 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.- 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")
.- decorators
-
" (
list
ofteal_transform_module
, namedlist
ofteal_transform_module
or"NULL
) optional, if notNULL
, decorator for tables or plots included in the module. When a named list ofteal_transform_module
, the decorators are applied to the respective output objects.Otherwise, the decorators are applied to all objects, which is equivalent as using the name
default
.See section "Decorating Module" below for more details.
Decorating Module
This module generates the following objects, which can be modified in place using decorators:
table
(ElementaryTable
- output ofrtables::build_table
)
For additional details and examples of decorators, refer to the vignette
vignette("decorate-modules-output", package = "teal")
or the teal_transform_module()
documentation.
See also
The TLG Catalog where additional example apps implementing this module can be found.
Examples
library(dplyr)
#>
#> Attaching package: ‘dplyr’
#> The following object is masked from ‘package:testthat’:
#>
#> matches
#> The following objects are masked from ‘package:stats’:
#>
#> filter, lag
#> The following objects are masked from ‘package:base’:
#>
#> intersect, setdiff, setequal, union
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()
})
join_keys(data) <- default_cdisc_join_keys[names(data)]
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)
)
)
)
#> Initializing tm_a_gee (prototype)
#> Initializing reporter_previewer_module
if (interactive()) {
shinyApp(app$ui, app$server)
}