Learn R Programming

rprev (version 1.0.5)

summary.survfit.prev: Obtain N-year survival probability estimates.

Description

Summarises survival information at pre-specified years of interest on a survfit.prev object.

Usage

# S3 method for survfit.prev
summary(object, years = c(1, 3, 5), ...)

Arguments

object

A survfit.prev object.

years

A vector of years for which to estimate survival probability from the bootstrapped survival curves.

...

Arguments passed to main summary function.

Value

None, displays the survival probabilities to screen as a side-effect.

Details

Survival probability is estimated as the mean of the bootstrapped survival curves at a specific timepoint, with 2.5 confidence intervals. Survival probability can only be estimated at time points less than the maximum survival time in the original dataset that the prevalence object was fitted to.

Examples

Run this code
# NOT RUN {
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))

summary(survobj)

summary(survobj, years=c(1, 3, 5, 7))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab