Skip to content

An R-package for performing dynamic path analysis on survival data with estimation of the corresponding direct, indirect, and total effects.

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

Novartis/dpasurv

Repository files navigation

dpasurv

R-package for Dynamic Path Analysis of survival data.

Overview

The dpasurv package is designed to perform dynamic path analysis via calls to the following principal functions:

  • dpa() fits the dynamic path models corresponding to a given dynamic path diagram; returns an object of class dpa
  • effect() estimates the cumulative direct and indirect effects from the fitted dpa-object; returns an object of class effect

The effect-objects can be summed together to obtain the total effect (i.e. direct effect + indirect effect) as well as plotted with bootstrap confidence intervals.

Installation

# To install the most recent stable version on CRAN:
install.packages("dpasurv")

# To get bug fixes or new features, install the development version:
devtools::install_github("Novartis/dpasurv")

Usage

A vignette on how to use the dpasurv package can be found here, and basic usage is summarized below:

library(dpasurv)

# Perform dynamic path analysis
s <- dpa(Surv(start, stop, event) ~ M + x, list(M ~ x), id = "subject", data = simdata, boot.n = 500)

# Extract direct, indirect and total effect
direct <- effect(x ~ outcome, s, alpha=0.05)
indirect <- effect(x ~ M ~ outcome, s, alpha=0.05)
total <- sum(direct, indirect)

# Plot the results
par(mfrow=c(1,3))
plot(direct); abline(h=0, lty=2, col=2)
plot(indirect); abline(h=0, lty=2, col=2)
plot(total); abline(h=0, lty=2, col=2)

# Plot the results with ggplot2 graphics:
ggplot.effect(list(direct, indirect, total))

Citation

The dpasurv package was created as supplementary code for the following manuscript:

@article{dpasurv,
  title={Dynamic path analysis for exploring treatment effect mediation processes in clinical trials with time-to-event endpoints},
  author={Kormaksson, M. and Lange, M. R. and Demanse, D. and Strohmaier, S. and Duan, J. and Xie, Q. and Carbini, M. and Bossen, C. and Guettner, A. and Maniero, A.},
  journal={Statistics in Medicine (Accepted)},
  volume={},
  number={},
  pages={},
  year={2024},
}

If you publish results obtained from the dpasurv package, please cite the above paper.

Code authors

About

An R-package for performing dynamic path analysis on survival data with estimation of the corresponding direct, indirect, and total effects.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published