getsurv2: Function to retrieve the survival probabilities at a specific...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

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

Usage

1
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

Details

The survival probabilities are estimated through the survfit function.

Value

vector of survival probabilities

Author(s)

Benjamin Haibe-Kains

See Also

survfit

Examples

1
2
3
4
5
6
7
8
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)

bhklab/survcomp documentation built on Dec. 26, 2021, 6:41 a.m.