h_biomarkers_subgroups | R Documentation |
h_tab_one_biomarker(
df,
afuns,
colvars,
na_str = default_na_str(),
...,
.stats = NULL,
.stat_names = NULL,
.formats = NULL,
.labels = NULL,
.indent_mods = NULL
)
h_tab_rsp_one_biomarker(
df,
vars,
na_str = default_na_str(),
.indent_mods = 0L,
...
)
h_tab_surv_one_biomarker(
df,
vars,
time_unit,
na_str = default_na_str(),
.indent_mods = 0L,
...
)
df |
( |
afuns |
(named |
colvars |
(named |
na_str |
( |
... |
additional arguments for the lower level functions. |
.stats |
( |
.stat_names |
( |
.formats |
(named |
.labels |
(named |
.indent_mods |
(named |
vars |
( |
time_unit |
( |
An rtables
table object with statistics in columns.
h_tab_one_biomarker()
: Helper function to calculate statistics in columns for one biomarker.
h_tab_rsp_one_biomarker()
: Helper function that prepares a single response sub-table given the results for a
single biomarker.
h_tab_surv_one_biomarker()
: Helper function that prepares a single survival sub-table given the results for a
single biomarker.
library(dplyr)
library(forcats)
adrs <- tern_ex_adrs
adrs_labels <- formatters::var_labels(adrs)
adrs_f <- adrs %>%
filter(PARAMCD == "BESRSPI") %>%
mutate(rsp = AVALC == "CR")
formatters::var_labels(adrs_f) <- c(adrs_labels, "Response")
# For a single population, separately estimate the effects of two biomarkers.
df <- h_logistic_mult_cont_df(
variables = list(
rsp = "rsp",
biomarkers = c("BMRKR1", "AGE"),
covariates = "SEX"
),
data = adrs_f
)
# Starting from above `df`, zoom in on one biomarker and add required columns.
df1 <- df[1, ]
df1$subgroup <- "All patients"
df1$row_type <- "content"
df1$var <- "ALL"
df1$var_label <- "All patients"
h_tab_rsp_one_biomarker(
df1,
vars = c("n_tot", "n_rsp", "prop", "or", "ci", "pval")
)
adtte <- tern_ex_adtte
# Save variable labels before data processing steps.
adtte_labels <- formatters::var_labels(adtte, fill = FALSE)
adtte_f <- adtte %>%
filter(PARAMCD == "OS") %>%
mutate(
AVALU = as.character(AVALU),
is_event = CNSR == 0
)
labels <- c("AVALU" = adtte_labels[["AVALU"]], "is_event" = "Event Flag")
formatters::var_labels(adtte_f)[names(labels)] <- labels
# For a single population, separately estimate the effects of two biomarkers.
df <- h_coxreg_mult_cont_df(
variables = list(
tte = "AVAL",
is_event = "is_event",
biomarkers = c("BMRKR1", "AGE"),
covariates = "SEX",
strata = c("STRATA1", "STRATA2")
),
data = adtte_f
)
# Starting from above `df`, zoom in on one biomarker and add required columns.
df1 <- df[1, ]
df1$subgroup <- "All patients"
df1$row_type <- "content"
df1$var <- "ALL"
df1$var_label <- "All patients"
h_tab_surv_one_biomarker(
df1,
vars = c("n_tot", "n_tot_events", "median", "hr", "ci", "pval"),
time_unit = "days"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.