View source: R/response_biomarkers_subgroups.R
| extract_rsp_biomarkers | R Documentation |
Prepares estimates for number of responses, patients and overall response rate,
as well as odds ratio estimates, confidence intervals and p-values,
for multiple biomarkers across population subgroups in a single data frame.
variables corresponds to the names of variables found in data, passed as a
named list and requires elements rsp and biomarkers (vector of continuous
biomarker variables) and optionally covariates, subgroups and strata.
groups_lists optionally specifies groupings for subgroups variables.
extract_rsp_biomarkers(
variables,
data,
groups_lists = list(),
control = control_logistic(),
label_all = "All Patients"
)
variables |
(named |
data |
( |
groups_lists |
(named |
control |
(named |
label_all |
( |
A data.frame with columns biomarker, biomarker_label, n_tot, n_rsp,
prop, or, lcl, ucl, conf_level, pval, pval_label, subgroup, var,
var_label, and row_type.
You can also specify a continuous variable in rsp and then use the
response_definition control to convert that internally to a logical
variable reflecting binary response.
h_logistic_mult_cont_df() which is used internally.
library(dplyr)
library(forcats)
adrs <- tern_ex_adrs
adrs_labels <- formatters::var_labels(adrs)
adrs_f <- adrs %>%
filter(PARAMCD == "BESRSPI") %>%
mutate(rsp = AVALC == "CR")
# Typical analysis of two continuous biomarkers `BMRKR1` and `AGE`,
# in logistic regression models with one covariate `RACE`. The subgroups
# are defined by the levels of `BMRKR2`.
df <- extract_rsp_biomarkers(
variables = list(
rsp = "rsp",
biomarkers = c("BMRKR1", "AGE"),
covariates = "SEX",
subgroups = "BMRKR2"
),
data = adrs_f
)
df
# Here we group the levels of `BMRKR2` manually, and we add a stratification
# variable `STRATA1`. We also here use a continuous variable `EOSDY`
# which is then binarized internally (response is defined as this variable
# being larger than 750).
df_grouped <- extract_rsp_biomarkers(
variables = list(
rsp = "EOSDY",
biomarkers = c("BMRKR1", "AGE"),
covariates = "SEX",
subgroups = "BMRKR2",
strata = "STRATA1"
),
data = adrs_f,
groups_lists = list(
BMRKR2 = list(
"low" = "LOW",
"low/medium" = c("LOW", "MEDIUM"),
"low/medium/high" = c("LOW", "MEDIUM", "HIGH")
)
),
control = control_logistic(
response_definition = "I(response > 750)"
)
)
df_grouped
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.