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, ]
)
Run the code above in your browser using DataLab