| plot_rmst_individual_by_group | R Documentation |
Plot individual dynamic RMST curves by group
plot_rmst_individual_by_group(
res,
group,
n_show_per_group = 30,
title = "Individual dynamic RMST by group",
x_scale = 1,
y_scale = 1,
x_unit = NULL,
y_unit = NULL
)
res |
Result from |
group |
Group vector aligned with rows of |
n_show_per_group |
Maximum number of individual curves shown per group. |
title |
Plot title. |
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. |
A ggplot object.
time <- c(0, 1, 2)
S <- rbind(
c(1.0, 0.9, 0.7),
c(1.0, 0.8, 0.6),
c(1.0, 0.95, 0.8),
c(1.0, 0.85, 0.7)
)
grp <- c("A", "A", "B", "B")
x <- as_survmat(S, time, group = grp)
res <- rmst_dynamic(x)
plot_rmst_individual_by_group(res, grp, n_show_per_group = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.