prop_trans_inc_dens_ce: Probability Transform Incidence Density Accounting for...

View source: R/prop_trans_inc_dens_ce.R

prop_trans_inc_dens_ceR Documentation

Probability Transform Incidence Density Accounting for Competing Events

Description

This function calculates the incidence density of both adverse events and specified competing events observed in ⁠[0, tau]⁠ and then combines and transforms the incidence densities on a probability scale. Please also refer to formulas (4) and (5) in \insertCitestegherr_survival_2021;textualsavvyr.

Usage

prop_trans_inc_dens_ce(data, ce, 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.

ce

(number)
code for competing event.

tau

(number)
milestone at which Probability Transform Incidence Density is computed.

Value

(vector)
with the following entries:

  • ae_prob: Estimated probability of AE.

  • ae_prob_var: Variance of that estimate.

References

\insertRef

stegherr_survival_2021savvyr

Examples

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

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