These templates are helpful when we are interested in modelling the effects of continuous biomarker variables on a time-to-event (survival) outcome, conditional on covariates and/or stratification variables included in Cox proportional hazards regression models. We would like to assess how the estimates effects change when we look at different subgroups.
In detail the differences to the other survival forest graphs (SFG1 to SFG5) are the following:
The extract_survival_subgroups() and tabulate_survival_subgroups() functions evaluate the treatment effects comparing two arms, across subgroups. On the other hand, the extract_survival_biomarkers() and tabulate_survival_biomarkers() functions used here in SFG6 evaluate the effects from continuous biomarkers in the Cox proportional hazards models, across subgroups.
The extract_survival_subgroups() and tabulate_survival_subgroups() functions only allow specification of a single treatment arm variable, while the extract_survival_biomarkers() and tabulate_survival_biomarkers() allow to look at multiple continuous biomarker variables at once.
In addition to the treatment arms, the use of extract_survival_subgroups() and tabulate_survival_subgroups() functions can be extended to other binary variables, as done in SFG3 and SFG4. For example, we could define the binarized ARM variable as AGE>=65 vs. AGE<65 and then look at the odds ratios across subgroups. For the extract_survival_biomarkers() and tabulate_survival_biomarkers() functions, we could use the original continuous biomarker variable AGE, and then look at the estimated effect across subgroups.
Similarly like in SFG3, we will use the cadtte data set from the random.cdisc.data package. Here we just filter for the overall survival outcome in a single arm in the biomarker evaluable population.
Here we specify that we would like to analyze the two continuous biomarkers BMRKR1 and AGE, conditional on the covariate SEX, in the subgroups defined by the levels of BMRKR2.
Total Events Total n Median (Months) Hazard Ratio 95% Wald CI
————————————————————————————————————————————————————————————————————————————————————————————————————————
Age
All Patients 26 68 NA 0.96 (0.91, 1.02)
Categorical Level Biomarker 2
LOW 12 26 NA 0.90 (0.79, 1.03)
MEDIUM 7 20 NA 1.02 (0.91, 1.13)
HIGH 7 22 NA 0.95 (0.83, 1.09)
Biomarker (Countinuous)
All Patients 26 68 NA 1.11 (1.01, 1.23)
Categorical Level Biomarker 2
LOW 12 26 NA 1.24 (1.04, 1.47)
MEDIUM 7 20 NA 1.09 (0.92, 1.30)
HIGH 7 22 NA 1.09 (0.80, 1.47)
Note that in addition to the Categorical Level Biomarker 2 subgroups we automatically also get the estimates for the overall patient population in the All Patients rows.
We can then produce the final forest plot using the g_forest() function on this tabular result.
Code
g_forest(result, xlim =c(0.7, 1.4))
Here we can see that the continuous biomarker (BMRKR1) shows a trend towards an estimated positive effect on survival (it is not statistically significant though as the confidence intervals still overlap the hazard ratio 1). It is a bit easier to see this here rather than in a cutpoint analysis as presented in SFG3.
---title: SFG6Asubtitle: Survival Forest Graph for Multiple Continuous Biomarkerscategories: [SFG]---------------------------------------------------------------------------::: panel-tabset{{< include setup.qmd >}}## PlotHere we specify that we would like to analyze the two continuous biomarkers `BMRKR1` and `AGE`, conditional on the covariate `SEX`, in the subgroups defined by the levels of `BMRKR2`.```{r}df <-extract_survival_biomarkers(variables =list(tte ="AVAL",is_event ="is_event",biomarkers =c("BMRKR1", "AGE"),covariates ="SEX",subgroups ="BMRKR2" ),data = adtte_f)result <-tabulate_survival_biomarkers(df = df,vars =c("n_tot_events", "n_tot", "median", "hr", "ci"),time_unit = adtte_f$AVALU[1])```We can look at the result in the console already.```{r}result```Note that in addition to the `Categorical Level Biomarker 2` subgroups we automatically also get the estimates for the overall patient population in the `All Patients` rows.We can then produce the final forest plot using the `g_forest()` function on this tabular result.```{r, fig.width = 15}g_forest(result, xlim = c(0.7, 1.4))```Here we can see that the continuous biomarker (`BMRKR1`) shows a trend towards an estimated positive effect on survival (it is not statistically significant though as the confidence intervals still overlap the hazard ratio 1).It is a bit easier to see this here rather than in a cutpoint analysis as presented in [SFG3](../../graphs/SFG3/sfg03.qmd).{{< include ../../misc/session_info.qmd >}}:::