Title: | Survival Analysis for AdVerse Events with VarYing Follow-Up Times |
---|---|
Description: | The SAVVY (Survival Analysis for AdVerse Events with VarYing Follow-Up Times) project is a consortium of academic and pharmaceutical industry partners that aims to improve the analyses of adverse event (AE) data in clinical trials through the use of survival techniques appropriately dealing with varying follow-up times and competing events, see Stegherr, Schmoor, Beyersmann, et al. (2021) <doi:10.1186/s13063-021-05354-x>. Although statistical methodologies have advanced, in AE analyses often the incidence proportion, the incidence density or a non-parametric Kaplan-Meier estimator are used, which either ignore censoring or competing events. This package contains functions to easily conduct the proposed improved AE analyses. |
Authors: | Thomas Kuenzel [aut, cre], Kaspar Rufibach [aut], Regina Stegherr [aut], Daniel Sabanés Bové [aut], F. Hoffmann-La Roche AG [cph, fnd], Universität Ulm [cph, fnd] |
Maintainer: | Thomas Kuenzel <[email protected]> |
License: | Apache License 2.0 |
Version: | 0.1.1 |
Built: | 2024-11-03 04:55:27 UTC |
Source: | https://github.com/openpharma/savvyr |
This function calculates the Aalen Johansen estimator of
adverse events observed in [0, tau]
.
Please also refer to Stegherr et al. (2021).
aalen_johansen(data, ce, tau)
aalen_johansen(data, ce, tau)
data |
(
|
ce |
( |
tau |
( |
(vector
)
with the following entries:
ae_prob
: Estimated probability of AE.
ae_prob_var
: Variance of that estimate.
ce_prob
: Estimated probability of competing events.
ce_prob_var
: Variance of competing events.
Stegherr R, Schmoor C, Lübbert M, Friede T, Beyersmann J (2021). “Estimating and comparing adverse event probabilities in the presence of varying follow-up times and competing events.” Pharmaceutical Statistics, 20(6), 1125–1146. doi:10.1002/pst.2130, https://onlinelibrary.wiley.com/doi/abs/10.1002/pst.2130.
set.seed(123) dat <- generate_data(n = 5, cens = c(2, 5), haz_ae = 2, haz_death = 3, haz_soft = 5) aalen_johansen(dat, ce = 2, tau = 4)
set.seed(123) dat <- generate_data(n = 5, cens = c(2, 5), haz_ae = 2, haz_death = 3, haz_soft = 5) aalen_johansen(dat, ce = 2, tau = 4)
This generates the dataset denoted by S1
in Table 4 of
Stegherr et al. (2021),
i.e. we assume constant hazards for the adverse event (AE) hazard, the
hazard for the competing event of death, and the hazard for the "soft"
competing events. Censoring is uniform in the given range.
generate_data(n, cens, haz_ae, haz_death, haz_soft)
generate_data(n, cens, haz_ae, haz_death, haz_soft)
n |
( |
cens |
( |
haz_ae |
( |
haz_death |
( |
haz_soft |
( |
(data.frame
)
a data.frame
with the following columns:
id
: Patient ID.
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.
cens
: Censoring time.
Stegherr R, Schmoor C, Lübbert M, Friede T, Beyersmann J (2021). “Estimating and comparing adverse event probabilities in the presence of varying follow-up times and competing events.” Pharmaceutical Statistics, 20(6), 1125–1146. doi:10.1002/pst.2130, https://onlinelibrary.wiley.com/doi/abs/10.1002/pst.2130.
set.seed(123) generate_data(n = 5, cens = c(2, 5), haz_ae = 2, haz_death = 3, haz_soft = 5)
set.seed(123) generate_data(n = 5, cens = c(2, 5), haz_ae = 2, haz_death = 3, haz_soft = 5)
Computing the Incidence Proportion
inc_prop(data, tau)
inc_prop(data, tau)
data |
(
|
tau |
( |
(vector
)
with the following entries:
ae_prob
: Estimated probability of AE.
ae_prob_var
: Variance of that estimate.
set.seed(123) dat <- generate_data( n = 5, cens = c(2, 5), haz_ae = 2, haz_death = 3, haz_soft = 5 ) inc_prop(dat, tau = 4)
set.seed(123) dat <- generate_data( n = 5, cens = c(2, 5), haz_ae = 2, haz_death = 3, haz_soft = 5 ) inc_prop(dat, tau = 4)
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 Stegherr et al. (2021).
one_minus_kaplan_meier(data, tau)
one_minus_kaplan_meier(data, tau)
data |
(
|
tau |
( |
(vector
)
with the following entries:
ae_prob
: Estimated probability of AE.
ae_prob_var
: Variance of that estimate.
Stegherr R, Beyersmann J, Jehl V, Rufibach K, Leverkus F, Schmoor C, Friede T (2021). “Survival analysis for AdVerse events with VarYing follow-up times (SAVVY): Rationale and statistical concept of a meta-analytic study.” Biometrical Journal, 63(3), 650-670. doi:10.1002/bimj.201900347, https://onlinelibrary.wiley.com/doi/pdf/10.1002/bimj.201900347, https://onlinelibrary.wiley.com/doi/abs/10.1002/bimj.201900347.
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)
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)
Computing the Probability Transform Incidence Density
prop_trans_inc_dens(data, tau)
prop_trans_inc_dens(data, tau)
data |
(
|
tau |
( |
(vector
)
with the following entries:
ae_prob
: Estimated probability of AE.
ae_prob_var
: Variance of that estimate.
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(dat, tau = 4)
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(dat, tau = 4)
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 Stegherr et al. (2021).
prop_trans_inc_dens_ce(data, ce, tau)
prop_trans_inc_dens_ce(data, ce, tau)
data |
(
|
ce |
( |
tau |
( |
(vector
)
with the following entries:
ae_prob
: Estimated probability of AE.
ae_prob_var
: Variance of that estimate.
Stegherr R, Schmoor C, Beyersmann J, Rufibach K, Jehl V, Brückner A, Eisele L, Künzel T, Kupas K, Langer F, Leverkus F, Loos A, Norenberg C, Voss F, Friede T (2021). “Survival analysis for AdVerse events with VarYing follow-up times (SAVVY)—estimation of adverse event risks.” Trials, 22(1), 420. ISSN 1745-6215, doi:10.1186/s13063-021-05354-x.
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)
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)