getsurv2 {survcomp} | R Documentation

## 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

### Details

The survival probabilities are estimated through the `survfit` function.

### Value

vector of survival probabilities

### Author(s)

Benjamin Haibe-Kains

### See Also

`survfit`

### Examples

    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)

[Package survcomp version 1.38.0 Index]