plot_rmst_two_arms: Plot mean RMST curves for two arms

View source: R/plots.R

plot_rmst_two_armsR Documentation

Plot mean RMST curves for two arms

Description

Plot mean RMST curves for two arms

Usage

plot_rmst_two_arms(
  xA,
  xB,
  labels = c("Arm A", "Arm B"),
  title = NULL,
  xlab = "Time (tau)",
  ylab = "RMST(tau)",
  curve_colors = c("#1B6CA8", "#D95F02"),
  x_scale = 1,
  y_scale = 1,
  x_unit = NULL,
  y_unit = NULL
)

Arguments

xA

A survmat object for arm A.

xB

A survmat object for arm B.

labels

Two legend labels.

title

Plot title. Use NULL to omit it.

xlab

X-axis label.

ylab

Y-axis label.

curve_colors

Colors for the two curves.

x_scale

Positive divisor applied to the x-axis values before plotting.

y_scale

Positive divisor applied to the y-axis values before plotting.

x_unit

Optional unit label appended to the x-axis title.

y_unit

Optional unit label appended to the y-axis title.

Value

A ggplot object.

Examples


time <- c(0, 1, 2)
xA <- as_survmat(rbind(c(1.0, 0.9, 0.7), c(1.0, 0.8, 0.6)), time, group = c("A", "A"))
xB <- as_survmat(rbind(c(1.0, 0.95, 0.8), c(1.0, 0.85, 0.7)), time, group = c("B", "B"))
plot_rmst_two_arms(xA, xB, labels = c("Control", "Treatment"))


tvrmst documentation built on March 17, 2026, 1:07 a.m.