Learn R Programming

rprev (version 0.2.3)

plot.survfit.prev: Plot bootstrapped survival curves.

Description

This method plots survival curves for a survfit.prev object.

Usage

"plot"(x, pct_show = 0.9, ...)

Arguments

x
A survfit.prev object.
pct_show
A list or dataframe with the covariate values to calculate survival probabilities.
...
Arguments passed to plot.

Value

An S3 object of class ggplot.

Details

The survival curve for a model formed on all the data is displayed in orange, while the 95 as a grey ribbon. Outlying survival curves are displayed in full, where the pct_show argument details the proportion of points outside of the confidence interval for a survival curve to be deemed as an outlier.

Examples

Run this code
data(prevsim)

## Not run: 
# prev_obj <- prevalence(Surv(time, status) ~ age(age) + sex(sex) +
#                        entry(entrydate) + event(eventdate),
#                        data=prevsim, num_years_to_estimate = c(5, 10),
#                        population_size=1e6, start = "2005-09-01",
#                        num_reg_years = 8, cure = 5)
# 
# survobj <- survfit(prev_obj, newdata=list(age=65, sex=0))
# 
# plot(survobj)
# 
# plot(survobj, pct_show=0)  # Display curves with any outlying points
# plot(survobj, pct_show=0.5)  # Display curves with half outlying points
# plot(survobj, pct_show=0.99)  # Display curves with nearly all outlying points
# ## End(Not run)

Run the code above in your browser using DataLab