Skip to contents

KM plot with curves per biomarker and treatment in a single panel

Usage

wrapper_KM_plot_interaction(
  data,
  tte_var,
  censor_var,
  biomarker_var,
  treatment_var,
  strat1_var = NULL,
  strat2_var = NULL,
  colors = NULL,
  palette = NULL,
  linetypes = 1,
  variable_names = NULL,
  title = TRUE,
  xlab = TRUE,
  strat1_label_both = TRUE,
  strat2_label_both = TRUE,
  legend_colors_title = TRUE,
  legend_position = c(0.03, 0.03),
  legend_justification = c(0, 0),
  break_time_by = NULL,
  max_tte = NULL,
  risk_table = TRUE,
  conf_int = FALSE,
  surv_median_line = "none",
  ggtheme = ggplot2::theme_get(),
  line_size = 1,
  title_size = NULL,
  label_size = NULL,
  rel_heights = c(5, 1.5),
  background_grid_major = "none",
  risk_table_labels = TRUE,
  print_hr = FALSE,
  print_mst = FALSE,
  print_pvalues = FALSE,
  print_options = NULL,
  cox_covariate_var = NULL,
  cox_strat_var = NULL,
  strat_scales = "fixed",
  strat1_nrow = 1,
  strat1_ncol = NULL,
  strat2_nrow = NULL,
  strat2_ncol = 1
)

Arguments

data

Data frame.

tte_var

Name of the variable containing time-to-event data.

censor_var

Name of the variable containing censoring information. Censor variable must be numeric and encode 1 for event and 0 for censor.

strat1_var

Name of the firts stratification variable.

strat2_var

Name of the second stratification variable.

colors

Vector with colors for treatment X biomarker levels. Unique colors can be generated with function `format_colors_cat_strata`.

risk_table_labels

Possible values: "levels", "shape"

print_options

Named vector. The default is c(npcx = 1, npcy = 0.05, hjust = 1, vjust = 0, size = 4) for text in the bottom right corner. For text in the top right corner use c(npcx = 1, npcy = 1, hjust = 1, vjust = 1, size = 4)