response_biomarkers_subgroups | R Documentation |
The tabulate_rsp_biomarkers()
function creates a layout element to tabulate the estimated biomarker effects on a
binary response endpoint across subgroups, returning statistics including response rate and odds ratio for each
population subgroup. The table is created from df
, a list of data frames returned by extract_rsp_biomarkers()
,
with the statistics to include specified via the vars
parameter.
A forest plot can be created from the resulting table using the g_forest()
function.
tabulate_rsp_biomarkers(
df,
vars = c("n_tot", "n_rsp", "prop", "or", "ci", "pval"),
na_str = default_na_str(),
.indent_mods = 0L
)
df |
( |
vars |
(
|
na_str |
( |
.indent_mods |
(named |
These functions create a layout starting from a data frame which contains the required statistics. The tables are then typically used as input for forest plots.
An rtables
table summarizing biomarker effects on binary response by subgroup.
In contrast to tabulate_rsp_subgroups()
this tabulation function does
not start from an input layout lyt
. This is because internally the table is
created by combining multiple subtables.
h_tab_rsp_one_biomarker()
which is used internally, extract_rsp_biomarkers()
.
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")
df <- extract_rsp_biomarkers(
variables = list(
rsp = "rsp",
biomarkers = c("BMRKR1", "AGE"),
covariates = "SEX",
subgroups = "BMRKR2"
),
data = adrs_f
)
## Table with default columns.
tabulate_rsp_biomarkers(df)
## Table with a manually chosen set of columns: leave out "pval", reorder.
tab <- tabulate_rsp_biomarkers(
df = df,
vars = c("n_rsp", "ci", "n_tot", "prop", "or")
)
## Finally produce the forest plot.
g_forest(tab, xlim = c(0.7, 1.4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.