Learn R Programming

rprev (version 0.2.3)

survfit.prevalence: Form bootstrapped survival curves.

Description

Calculates bootstrapped survival probabilities from the Weibull models fitted to the prevalence object.

Usage

"survfit"(formula, newdata = NULL, ...)

Arguments

formula
A prevalence object.
newdata
A list or dataframe with the covariate values to calculate survival probabilities for. Defaults to using the mean values from the the original dataset that the model was fit to.
...
Other arguments to survfit.

Value

An S3 object of class survfit.prev with the following attributes: attributes:

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)
# 
# survobj <- survfit(prev_obj, newdata=list(age=65, sex=0))
# ## End(Not run)

Run the code above in your browser using DataLab