Type: | Package |
Title: | Survival Analysis for AdVerse Events with VarYing Follow-Up Times |
Version: | 0.1.2 |
Date: | 2025-04-15 |
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. |
License: | Apache License 2.0 |
URL: | https://openpharma.github.io/savvyr/ |
BugReports: | https://github.com/openpharma/savvyr/issues |
Depends: | R (≥ 4.0) |
Imports: | checkmate, etm, Rdpack |
Suggests: | kableExtra, knitr, rmarkdown, testthat (≥ 3.0) |
Config/Needs/documentation: | roxytypes, roxylint |
RdMacros: | Rdpack |
VignetteBuilder: | knitr |
Encoding: | UTF-8 |
Language: | en-US |
RoxygenNote: | 7.3.2 |
NeedsCompilation: | no |
Packaged: | 2025-05-08 00:52:31 UTC; Daniel |
Author: | 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 <thomas.kuenzel@roche.com> |
Repository: | CRAN |
Date/Publication: | 2025-05-08 06:40:02 UTC |
savvyr: 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.
Author(s)
Maintainer: Thomas Kuenzel thomas.kuenzel@roche.com
Authors:
Kaspar Rufibach kaspar.rufibach@roche.com
Regina Stegherr regina.stegherr@uni-ulm.de
Daniel Sabanés Bové daniel@rconis.com
Other contributors:
F. Hoffmann-La Roche AG [copyright holder, funder]
Universität Ulm [copyright holder, funder]
See Also
Useful links:
Aalen Johansen Estimator
Description
This function calculates the Aalen Johansen estimator of
adverse events observed in [0, tau]
.
Please also refer to Stegherr et al. (2021).
Usage
aalen_johansen(data, ce, tau)
Arguments
data |
(
|
ce |
( |
tau |
( |
Value
(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.
References
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.
Examples
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)
Assertion of Adverse Event Data
Description
Custom assertion to check adverse event data sets.
Usage
assert_ae_data(data)
Arguments
data |
|
Value
None.
Generate Example Data
Description
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.
Usage
generate_data(n, cens, haz_ae, haz_death, haz_soft)
Arguments
n |
( |
cens |
( |
haz_ae |
( |
haz_death |
( |
haz_soft |
( |
Value
(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.
References
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.
Examples
set.seed(123)
generate_data(n = 5, cens = c(2, 5), haz_ae = 2, haz_death = 3, haz_soft = 5)
Computing the Incidence Proportion
Description
Computing the Incidence Proportion
Usage
inc_prop(data, tau)
Arguments
data |
(
|
tau |
( |
Value
(vector
)
with the following entries:
-
ae_prob
: Estimated probability of AE. -
ae_prob_var
: Variance of that estimate.
Examples
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)
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 Stegherr et al. (2021).
Usage
one_minus_kaplan_meier(data, tau)
Arguments
data |
(
|
tau |
( |
Value
(vector
)
with the following entries:
-
ae_prob
: Estimated probability of AE. -
ae_prob_var
: Variance of that estimate.
References
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.
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)
Computing the Probability Transform Incidence Density
Description
Computing the Probability Transform Incidence Density
Usage
prop_trans_inc_dens(data, tau)
Arguments
data |
(
|
tau |
( |
Value
(vector
)
with the following entries:
-
ae_prob
: Estimated probability of AE. -
ae_prob_var
: Variance of that estimate.
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(dat, tau = 4)
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 Stegherr et al. (2021).
Usage
prop_trans_inc_dens_ce(data, ce, tau)
Arguments
data |
(
|
ce |
( |
tau |
( |
Value
(vector
)
with the following entries:
-
ae_prob
: Estimated probability of AE. -
ae_prob_var
: Variance of that estimate.
References
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.
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)