h_response_biomarkers_subgroups {tern} | R Documentation |
Helper functions for tabulating biomarker effects on binary response by subgroup
Description
Helper functions which are documented here separately to not confuse the user when reading about the user-facing functions.
Usage
h_rsp_to_logistic_variables(variables, biomarker)
h_logistic_mult_cont_df(variables, data, control = control_logistic())
Arguments
variables |
(named |
biomarker |
( |
data |
( |
control |
(named |
Value
-
h_rsp_to_logistic_variables()
returns a namedlist
of elementsresponse
,arm
,covariates
, andstrata
.
-
h_logistic_mult_cont_df()
returns adata.frame
containing estimates and statistics for the selected biomarkers.
Functions
-
h_rsp_to_logistic_variables()
: helps with converting the "response" function variable list to the "logistic regression" variable list. The reason is that currently there is an inconsistency between the variable names accepted byextract_rsp_subgroups()
andfit_logistic()
. -
h_logistic_mult_cont_df()
: 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 in a given single data set.variables
corresponds to names of variables found indata
, passed as a named list and requires elementsrsp
andbiomarkers
(vector of continuous biomarker variables) and optionallycovariates
andstrata
.
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")
# This is how the variable list is converted internally.
h_rsp_to_logistic_variables(
variables = list(
rsp = "RSP",
covariates = c("A", "B"),
strata = "D"
),
biomarker = "AGE"
)
# For a single population, estimate separately the effects
# of two biomarkers.
df <- h_logistic_mult_cont_df(
variables = list(
rsp = "rsp",
biomarkers = c("BMRKR1", "AGE"),
covariates = "SEX"
),
data = adrs_f
)
df
# If the data set is empty, still the corresponding rows with missings are returned.
h_coxreg_mult_cont_df(
variables = list(
rsp = "rsp",
biomarkers = c("BMRKR1", "AGE"),
covariates = "SEX",
strata = "STRATA1"
),
data = adrs_f[NULL, ]
)