Skip to contents

Integrates the Kaplan-Meier estimator from 0 to tau using trapezoidal integration on the step-function. SE follows the Klein-Moeschberger formula (approximation matches the Python module).

Usage

morie_survival_rmst(time, event, tau = NULL, confidence = 0.95)

Arguments

time

Numeric vector of event/censoring times.

event

Integer/logical vector; 1 = event, 0 = censored.

tau

RMST truncation horizon (morie_survival_rmst/rmst_diff).

confidence

Confidence level for interval estimates (default 0.95).

Value

A named list with elements rmst, se, ci_lower, ci_upper, tau.

Examples

set.seed(1)
time <- rexp(60); event <- rbinom(60, 1, 0.7)
str(morie_survival_rmst(time, event, tau = 2), max.level = 1)
#> List of 5
#>  $ rmst    : num 0.996
#>  $ se      : num 0.086
#>  $ ci_lower: num 0.827
#>  $ ci_upper: num 1.16
#>  $ tau     : num 2