rmst_delta: Dynamic RMST difference between two arms

View source: R/estimands.R

rmst_deltaR Documentation

Dynamic RMST difference between two arms

Description

Computes Delta(tau) = RMST_B(tau) - RMST_A(tau).

Usage

rmst_delta(xA, xB, tau = NULL)

Arguments

xA

A survmat object for arm A.

xB

A survmat object for arm B.

tau

Optional numeric horizons for interpolation.

Value

A list with RMST curves for both arms and the delta curve.

Examples

time <- c(0, 1, 2)
xA <- as_survmat(rbind(c(1.0, 0.9, 0.7), c(1.0, 0.8, 0.6)), time, group = c("A", "A"))
xB <- as_survmat(rbind(c(1.0, 0.95, 0.8), c(1.0, 0.85, 0.7)), time, group = c("B", "B"))
rmst_delta(xA, xB, tau = 1.5)$at_tau

tvrmst documentation built on March 17, 2026, 1:07 a.m.