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
)
# \donttest{
## 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))
# }
Run the code above in your browser using DataLab