Description Usage Arguments Value Author(s)
This function produces plots of the survival point estimates using ggplot2
.
As a first argument it needs a list of estimates created by the one of the estimation function of the stremr
package.
See http://ggobi.github.io/ggally/#ggallyggsurv for additional modifications of the resulting output plot.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ggsurv(
estimates,
CI = TRUE,
CI_line = FALSE,
plot_cens = TRUE,
surv_col = "gg.def",
cens_col = "gg.def",
lty_est = 1,
shape_est = seq_along(estimates),
lty_ci = 2,
size_est = 0.5,
size_ci = size_est,
size_pt = size_est + 0.3,
cens_size = 2,
cens_shape = 3,
back_white = TRUE,
xlab = "Time",
ylab = "Survival",
main = "",
legend_pos = "right",
surv_name = "St." %+% estimates[[1L]][["est_name"]][1L],
SE_name = "SE." %+% estimates[[1L]][["est_name"]][1L],
order_legend = TRUE,
t_int_sel = NULL,
ymin = NULL,
...
)
|
estimates |
A list, one item per regime / intervention. Each list item must be a data.frame containing the survival estimates by time for a single regime / intervention. |
CI |
should a 95% confidence interval be plotted? Defaults to |
CI_line |
When |
plot_cens |
mark the censored observations? |
surv_col |
colour of the survival estimate. Defaults to black for
one stratum, and to the default |
cens_col |
colour of the points that mark censored observations. |
lty_est |
linetype of the survival curve(s). Vector length should be either 1 or equal to the number of strata. |
shape_est |
shape type of the survival point estimates. Vector length should be either 1 or equal to the number of strata. |
lty_ci |
linetype of the bounds that mark the 95% CI. |
size_est |
line width of the survival curve |
size_ci |
line width of the 95% CI |
size_pt |
point size of the survival estimate at each time-point |
cens_size |
point size of the censoring points |
cens_shape |
shape of the points that mark censored observations. |
back_white |
if |
xlab |
the label of the x-axis. |
ylab |
the label of the y-axis. |
main |
the plot label. |
legend_pos |
Either the coordinates of the legend position inside the plot (e.g., (0.9, 0.2)) or the character word denoting the legend orientation with respect to the plot (e.g., "bottom", "right" or "left"). |
surv_name |
The name of the column containing the survival estimates. |
SE_name |
The name of the column containing the standard errors (SE) for each time-point estimate of survival. |
order_legend |
Set to |
t_int_sel |
The subset of time-point indices for which survival should be plotted. |
ymin |
The minimum value of the y axis. The default ( |
... |
Additional arguments (not used). |
An object of class ggplot
Original R code by Edwin Thoen edwinthoen@gmail.com, modified by Oleg Sofrygin oleg.sofrygin@gmail.com
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.