surv_search: Survival estimate at selected times

View source: R/search.R

surv_searchR Documentation

Description

Evaluates a step survival function at arbitrary times. The estimate is a decreasing piecewise-constant function with jumps at the event times, so the value at any time is the one of the previous event time.

Usage

surv_search(tvals, time, surv)

Arguments

tvals

vector of times at which the survival function is evaluated.

time

vector of ordered distinct event times.

surv

vector of survival estimates at each event time.

Value

The survival estimate at each of the tvals times.

Examples

time <- c(4, 7, 9, 15, 21, 67)
surv <- c(0.8, 0.7, 0.65, 0.55, 0.43, 0.22)

# survival at times 1, 10, 32 and 74
surv_search(c(1, 10, 32, 74), time, surv)

survrec documentation built on Sept. 22, 2026, 9:07 a.m.