one_minus_kaplan_meier: One Minus Kaplan-Meier

View source: R/one_minus_kaplan_meier.R

one_minus_kaplan_meierR Documentation

One Minus Kaplan-Meier

Description

This function calculates the one minus Kaplan-Meier estimator of adverse events (while censoring all competing events) observed in ⁠[0, tau]⁠. Please also refer to formula (4) in \insertCitestegherr_meta_analytic_2021;textualsavvyr.

Usage

one_minus_kaplan_meier(data, tau)

Arguments

data

(data.frame)
with columns including

  • time_to_event: Time to the first AE, death or soft competing event.

  • type_of_event: 0 for censored, 1 for AE, 2 for death, 3 for soft competing event.

tau

(number)
milestone at which One Minus Kaplan-Meier is computed.

Value

(vector)
with the following entries:

  • ae_prob: Estimated probability of AE.

  • ae_prob_var: Variance of that estimate.

References

\insertRef

stegherr_meta_analytic_2021savvyr

Examples

set.seed(123)
dat <- generate_data(n = 5, cens = c(2, 5), haz_ae = 2, haz_death = 3, haz_soft = 5)
one_minus_kaplan_meier(dat, tau = 4)

savvyr documentation built on June 8, 2025, 10:19 a.m.