Plot Method for surveff Objects
# S3 method for surveff
plot(
x,
type = "surv",
max_time = NULL,
strata_to_plot = NULL,
strata_colors = NULL,
conf_level = 0.95,
include_CI = TRUE,
curve_width = 1,
CI_alpha = 0.3,
legend_position = "right",
legend_title = NULL,
plot_title = NULL,
...
)A ggplot2 object.
A surveff object.
Type of plot: "surv" for survival curves or "survdiff" for treatment effect curves. Default "surv".
Maximum time to display on x-axis. If NULL, uses max(eval_times).
Vector of strata to plot. For type = "surv", must be
subset of treatment_levels. For type = "survdiff", must be subset of
contrast names (column names of difference_estimates). If NULL, plots all available strata.
Vector of color names/codes for strata. Length must match strata_to_plot. Order matches strata order. If NULL, uses ggplot2 default colors.
Confidence level for confidence intervals. Default 0.95.
Logical. Include confidence interval ribbons? Default TRUE.
Line width for survival/difference curves. Default 1.
Transparency level for CI ribbons (0-1). Default 0.3.
Position of legend: "right" or "bottom". Default "right".
Title for legend. If NULL, uses "Treatment" for type="surv" or "Comparison" for type="survdiff".
Plot title. If NULL, uses default title based on type.
Additional arguments (ignored).
Creates publication-ready plots of survival curves or treatment effects over time.
For type = "surv": Plots estimated survival functions with optional
confidence intervals. Y-axis ranges from 0 to 1.
For type = "survdiff": Plots estimated treatment effects (survival differences)
with optional confidence intervals. Y-axis is not constrained to [0,1].