| plot.surveff | R Documentation |
Plot Method for surveff Objects
## S3 method for class '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,
...
)
x |
A |
type |
Type of plot: "surv" for survival curves or "survdiff" for treatment effect curves. Default "surv". |
max_time |
Maximum time to display on x-axis. If NULL, uses max(eval_times). |
strata_to_plot |
Vector of strata to plot. For |
strata_colors |
Vector of color names/codes for strata. Length must match strata_to_plot. Order matches strata order. If NULL, uses ggplot2 default colors. |
conf_level |
Confidence level for confidence intervals. Default 0.95. |
include_CI |
Logical. Include confidence interval ribbons? Default TRUE. |
curve_width |
Line width for survival/difference curves. Default 1. |
CI_alpha |
Transparency level for CI ribbons (0-1). Default 0.3. |
legend_position |
Position of legend: "right" or "bottom". Default "right". |
legend_title |
Title for legend. If NULL, uses "Treatment" for type="surv" or "Comparison" for type="survdiff". |
plot_title |
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].
A ggplot2 object.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.