Learn R Programming

lrstat (version 0.2.13)

rmst: Restricted Mean Survival Time

Description

Obtains the restricted mean survival time over an interval.

Usage

rmst(t1 = 0, t2 = NA_real_, piecewiseSurvivalTime = 0L, lambda = NA_real_)

Value

The integral of the survival function from t1 to t2

Arguments

t1

Lower bound of the analysis time interval.

t2

Upper bound of the analysis time interval.

piecewiseSurvivalTime

A vector that specifies the starting time of piecewise exponential survival time intervals. Must start with 0, e.g., c(0, 6) breaks the time axis into 2 event intervals: [0, 6) and [6, Inf). Defaults to 0 for exponential distribution.

lambda

A vector of hazard rates for the event. One for each analysis time interval.

Author

Kaifeng Lu, kaifenglu@gmail.com

Examples

Run this code

rmst(t1 = 0, t2 = 7, piecewiseSurvivalTime = c(0, 6),
     lambda = c(0.0533, 0.0309))

Run the code above in your browser using DataLab