Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


survcomp (version 1.22.0)

getsurv2: Function to retrieve the survival probabilities at a specific point in time

Description

The function retrieves the survival probabilities from a survfit object, for a specific point in time.

Usage

getsurv2(sf, time, which.est = c("point", "lower", "upper"))

Arguments

sf
survfit object
time
time at which the survival probabilities must be retrieved
which.est
which estimation to be returned? point for the point estimate, lower for the lower bound and upper for the upper bound

Value

vector of survival probabilities

Details

The survival probabilities are estimated through the survfit function.

See Also

survfit

Examples

Run this code
require(survival)
set.seed(12345)
age <- rnorm(30, 50, 10)
stime <- rexp(30)
cens <- runif(30,.5,2)
sevent <- as.numeric(stime <= cens)
stime <- pmin(stime, cens)
sf <- survfit(Surv(stime, sevent) ~ 1)
getsurv2(sf, time=1)

Run the code above in your browser using DataLab