MyNixOS website logo
Description

Dynamic Path Analysis of Survival Data via Aalen's Additive Hazards Model.

Dynamic path analysis with estimation of the corresponding direct, indirect, and total effects, based on Fosen et al., (2006) <doi:10.1007/s10985-006-9004-2>. The main outcome of interest is a counting process from survival analysis (or recurrent events) data. At each time of event, ordinary linear regression is used to estimate the relation between the covariates, while Aalen's additive hazard model is used for the regression of the counting process on the covariates.

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

Metadata

Version

0.1.0

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows