getsurv2 {survcomp} | R Documentation |
The function retrieves the survival probabilities from a survfit object, for a specific point in time.
getsurv2(sf, time, which.est = c("point", "lower", "upper"))
sf |
|
time |
time at which the survival probabilities must be retrieved |
which.est |
which estimation to be returned? |
The survival probabilities are estimated through the survfit
function.
vector of survival probabilities
Benjamin Haibe-Kains
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)