rmst_dynamic: Dynamic RMST trajectories

View source: R/estimands.R

rmst_dynamicR Documentation

Dynamic RMST trajectories

Description

Computes ⁠RMST_i(tau) = integral_0^tau S_i(u) du⁠ over the provided grid.

Usage

rmst_dynamic(x, tau = NULL, by = x$group)

Arguments

x

A survmat object.

tau

Optional numeric horizons for interpolation.

by

Optional grouping variable. Defaults to x$group.

Value

A list with individual and mean RMST curves.

Examples

time <- c(0, 1, 2)
S <- rbind(
  c(1.0, 0.8, 0.6),
  c(1.0, 0.7, 0.5)
)
x <- as_survmat(S, time, group = c("A", "A"))
res <- rmst_dynamic(x, tau = c(0.5, 1.5))
res$mean
res$at_tau

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