A setup similar to KG1 is used, with some additional data manipulation steps to first binarize the continuous biomarker and the treatment arm variables, and then combine both into a new interaction variable ARM_BMRKR2. Since we are using biomarker information, we filter on the biomarker evaluable population using the flag variable BEP01FL.
For reordering or renaming we can just modify the levels of the corresponding factors of the treatment arm and biomarker variables, and pass the result to g_km() as before.
---title: KG4Bsubtitle: Reorder and Rename Treatment Arms or Biomarker Groups in Kaplan-Meier Graph by Treatment Arm and Biomarker Subgroupscategories: [KG]---------------------------------------------------------------------------::: panel-tabset{{< include setup.qmd >}}## PlotFor reordering or renaming we can just modify the levels of the corresponding factors of the treatment arm and biomarker variables, and pass the result to `g_km()` as before.```{r, fig.width=9, fig.height=6}adtte_mod <- adtte %>% mutate( ARM_BMRKR2 = fct_collapse_only( ARM_BMRKR2, TRT.Low = "TRT.Low", TRT.High = "TRT.High", CTRL.Low = "CTRL.Low", CTRL.High = "CTRL.High" ) )g_km( df = adtte_mod, variables = variables, annot_surv_med = FALSE, col = c("red", "blue", "red", "blue"), lty = c(1, 1, 2, 2))```{{< include ../../misc/session_info.qmd >}}:::