View source: R/tm_t_glm_counts.R
tm_t_glm_counts | R Documentation |
Summarize results of a Poisson negative binomial regression that is result of a generalized linear model of one (e.g. arm) or more covariates.
tm_t_glm_counts(
label = "Counts Module",
dataname,
parentname = ifelse(inherits(arm_var, "data_extract_spec"),
teal.transform::datanames_input(arm_var), "ADSL"),
aval_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname,
"AVAL"), "AVAL", fixed = TRUE),
arm_var,
strata_var,
rate_mean_method = c("emmeans", "ppmeans"),
distribution = c("negbin", "quasipoisson", "poisson"),
offset_var,
cov_var,
arm_ref_comp = NULL,
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()
)
Teal module for tern::summarize_glm_count()
analysis, that summarizes results of a
Poisson negative binomial regression.
The arm and stratification variables are taken from the parentname
data.
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_glm_counts( ..., # 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.
summarize_glm_count()
data <- within(teal_data(), {
ADSL <- tern::tern_ex_adsl
ADTTE <- tern::tern_ex_adtte
})
join_keys(data) <- default_cdisc_join_keys[names(data)]
arm_ref_comp <- list(
ACTARMCD = list(
ref = "ARM B",
comp = c("ARM A", "ARM C")
),
ARM = list(
ref = "B: Placebo",
comp = c("A: Drug X", "C: Combination")
)
)
ADSL <- data[["ADSL"]]
ADTTE <- data[["ADTTE"]]
# Initialize the teal app
app <- init(
data = data,
modules = modules(
tm_t_glm_counts(
dataname = "ADTTE",
arm_var = choices_selected(
variable_choices(ADTTE, c("ARM", "ARMCD", "ACTARMCD")),
"ARMCD"
),
arm_ref_comp = arm_ref_comp,
aval_var = choices_selected(
variable_choices(ADTTE, "AVAL"),
"AVAL"
),
strata_var = choices_selected(
variable_choices(ADSL, "SEX"),
NULL
),
offset_var = choices_selected(
variable_choices(ADSL, "AGE"),
NULL
),
cov_var = choices_selected(
variable_choices(ADTTE, "SITEID"),
NULL
)
)
)
)
if (interactive()) {
shinyApp(ui = app$ui, server = app$server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.