Learn R Programming

targeted (version 0.6)

int_surv: Integral approximation of a time dependent function. Computes an approximation of \(\int_start^stop S(t) dt\), where \(S(t)\) is a survival function, for a selection of start and stop time points.

Description

Integral approximation of a time dependent function. Computes an approximation of \(\int_start^stop S(t) dt\), where \(S(t)\) is a survival function, for a selection of start and stop time points.

Usage

int_surv(times, surv, start = 0, stop = max(times), extend = FALSE)

Value

Numeric vector, value of the integral.

Arguments

times

Numeric vector, sorted time points.

surv

Numeric vector, values of a survival function evaluated at time points given by times.

start

Numeric vector, start of the integral.

stop

Numeric vector, end of the integral.

extend

(logical) If TRUE, integral is extended beyond the last observed time point

Author

Andreas Nordland