Tabulate Biomarker Effects on Binary Response by Subgroup
Source:R/response_biomarkers_subgroups.R
response_biomarkers_subgroups.Rd
Tabulate the estimated effects of multiple continuous biomarker variables on a binary response endpoint across population subgroups.
Usage
tabulate_rsp_biomarkers(
df,
vars = c("n_tot", "n_rsp", "prop", "or", "ci", "pval")
)
Arguments
- df
(
data.frame
)
containing all analysis variables, as returned byextract_rsp_biomarkers()
.- vars
-
(
character
)
the names of statistics to be reported among:n_tot
: Total number of patients per group.n_rsp
: Total number of responses per group.prop
: Total response proportion per group.or
: Odds ratio.ci
: Confidence interval of odds ratio.pval
: p-value of the effect. Note, the statisticsn_tot
,or
andci
are required.
Details
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.
Note
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.
See also
h_tab_rsp_one_biomarker()
which is used internally, extract_rsp_biomarkers()
.
Examples
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")
if (FALSE) {
## Table with default columns.
# df <- <need_data_input_to_work>
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))
}