diff --git a/LICENSE-text.html b/LICENSE-text.html index 87b53b8..12e41e7 100644 --- a/LICENSE-text.html +++ b/LICENSE-text.html @@ -35,27 +35,8 @@ -
MIT License
-
-Copyright (c) 2023 Novartis
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+
YEAR: 2024
+COPYRIGHT HOLDER: Novartis
 
diff --git a/LICENSE.html b/LICENSE.html new file mode 100644 index 0000000..d69a223 --- /dev/null +++ b/LICENSE.html @@ -0,0 +1,64 @@ + +MIT License • dpasurv + Skip to contents + + +
+
+
+ +
+ +

Copyright (c) 2024 Novartis

+

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

+

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

+

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+
+ +
+ + +
+ + + +
+ + + + + + + diff --git a/articles/dpa.html b/articles/dpa.html index c549af6..e0df196 100644 --- a/articles/dpa.html +++ b/articles/dpa.html @@ -59,7 +59,7 @@

Matthias Kormaksson

-

July 25, 2024

+

July 26, 2024

dpa.Rmd
diff --git a/articles/ggplot_demo.html b/articles/ggplot_demo.html index ea80091..c49c250 100644 --- a/articles/ggplot_demo.html +++ b/articles/ggplot_demo.html @@ -59,7 +59,7 @@

Markus Lange

-

July 25, 2024

+

July 26, 2024

ggplot_demo.Rmd
diff --git a/index.html b/index.html index 34890bd..ee9827f 100644 --- a/index.html +++ b/index.html @@ -137,8 +137,8 @@

Code authors diff --git a/news/index.html b/news/index.html index 9dd4736..4fcfdcc 100644 --- a/news/index.html +++ b/news/index.html @@ -37,7 +37,7 @@

dpasurv 0.1.0

-
  • Added a NEWS.md file to track changes to the package.
  • +
    • First release.
diff --git a/pkgdown.yml b/pkgdown.yml index aaec697..9905acf 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -4,7 +4,7 @@ pkgdown_sha: ~ articles: dpa: dpa.html ggplot_demo: ggplot_demo.html -last_built: 2024-07-25T18:58Z +last_built: 2024-07-26T19:11Z urls: reference: http://opensource.nibr.com/dpasurv/reference article: http://opensource.nibr.com/dpasurv/articles diff --git a/search.json b/search.json index 4eb849a..948055f 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"http://opensource.nibr.com/dpasurv/articles/dpa.html","id":"introduction","dir":"Articles","previous_headings":"","what":"1. Introduction","title":"The dpasurv package","text":"Dynamic path analysis introduced (Fosen et al. 2006) method performing mediation analysis longitudinal mediator time--event outcome. thorough review methodology can found tutorial paper (Kormaksson et al. 2024). vignette outline modeling framework define direct, indirect total effects context dynamic path analysis. demonstrate main functionalities package, namely estimation, inference, visualization.","code":""},{"path":[]},{"path":"http://opensource.nibr.com/dpasurv/articles/dpa.html","id":"dynamic-path-analysis","dir":"Articles","previous_headings":"2. Methods","what":"Dynamic path analysis","title":"The dpasurv package","text":"Dynamic path analysis involves modeling -called dynamic path diagrams one depicted Figure 1 (). dynamic path diagram defined (Fosen et al. 2006) time-indexed sequence directed acyclic graphs characterized treatment variable, ZZ, one longitudinal mediator variables, M(t)M(t), survival (time--event) outcome dN(t)=1(t≤T # A tibble: 1,229 × 7 #> subject x dose M start stop event #> #> 1 1 0 ctrl 6.74 0 4 0 #> 2 1 0 ctrl 6.91 4 8 0 #> 3 1 0 ctrl 6.9 8 12 0 #> 4 1 0 ctrl 6.71 12 26 0 #> 5 1 0 ctrl 6.45 26 46.8 1 #> 6 2 1 high 6.11 0 4 0 #> 7 2 1 high 6.28 4 8 0 #> 8 2 1 high 7.04 8 12 0 #> 9 2 1 high 6.93 12 26 0 #> 10 2 1 high 7.86 26 52 0 #> # ℹ 1,219 more rows"},{"path":"http://opensource.nibr.com/dpasurv/articles/dpa.html","id":"implementation-in-a-nutshell","dir":"Articles","previous_headings":"3. Getting started with dpasurv","what":"Implementation in a nutshell","title":"The dpasurv package","text":"see minimal code required performing dynamic path analysis simdata. explores direct effect treatment x survival well indirect effect mediated M:","code":"# Perform dynamic path analysis s <- dpa(Surv(start, stop, event) ~ M + x, list(M ~ x), id = \"subject\", data = simdata, boot.n = 500) # Extract cumulative direct and indirect effects with 95% pointwise bootstrap confidence bands: direct <- effect(x ~ outcome, s, alpha=0.05) indirect <- effect(x ~ M ~ outcome, s, alpha=0.05) # Use sum() method to obtain total effect 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))"},{"path":"http://opensource.nibr.com/dpasurv/articles/dpa.html","id":"simulated-use-case","dir":"Articles","previous_headings":"","what":"4. Simulated Use Case","title":"The dpasurv package","text":"Let us now use dpasurv package perform slightly depth analysis simdata.","code":""},{"path":"http://opensource.nibr.com/dpasurv/articles/dpa.html","id":"look-at-the-data","dir":"Articles","previous_headings":"4. Simulated Use Case","what":"Look at the data","title":"The dpasurv package","text":"Firstly, note dose response trend looking longitudinal trends subject mediator profiles: higher dose, higher average mediator value . also note dose response trend looking association dose levels survival Cox model dose mediator covariates reveals significant hazard ratio high dose, trend low dose (compared control), significant association mediator survival:","code":"ggplot(mapping=aes(x = start, y = M, group=dose), data=simdata) + geom_smooth(aes(colour=dose)) fit <- survival::survfit(Surv(start, stop, event) ~ dose, data=simdata) plot(fit, col=2:4, xlab=\"Time\", ylab=\"Survival\", main=\"KM-curves by dose level\") legend(150, 1, c(\"control\", \"low dose\", \"high dose\"), col=2:4, lwd=2, bty='n') summary(survival::coxph(Surv(start, stop, event) ~ dose + M, data=simdata)) #> Call: #> survival::coxph(formula = Surv(start, stop, event) ~ dose + M, #> data = simdata) #> #> n= 1229, number of events= 172 #> #> coef exp(coef) se(coef) z Pr(>|z|) #> doselow -0.32281 0.72411 0.18826 -1.715 0.08640 . #> dosehigh -0.66230 0.51566 0.20542 -3.224 0.00126 ** #> M 0.05274 1.05416 0.04863 1.085 0.27808 #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> #> exp(coef) exp(-coef) lower .95 upper .95 #> doselow 0.7241 1.3810 0.5007 1.0473 #> dosehigh 0.5157 1.9392 0.3448 0.7713 #> M 1.0542 0.9486 0.9583 1.1596 #> #> Concordance= 0.555 (se = 0.025 ) #> Likelihood ratio test= 10.57 on 3 df, p=0.01 #> Wald test = 10.51 on 3 df, p=0.01 #> Score (logrank) test = 10.7 on 3 df, p=0.01"},{"path":"http://opensource.nibr.com/dpasurv/articles/dpa.html","id":"dynamic-path-analysis-1","dir":"Articles","previous_headings":"4. Simulated Use Case","what":"Dynamic path analysis","title":"The dpasurv package","text":"Let’s now perform dynamic path analysis dpa() function calculate effects interest effect() function. confirm dose response mediator, appears significant high-dose vs control: also confirm dose response survival outcome, although high-dose appears significant: contrast conclusions Cox-model appears meaningful dynamic association mediator survival: particular, mediator effect neutral first 100 days starts significant detrimental effect survival (higher mediator value, higher risk).","code":"set.seed(1) s <- dpa(Surv(start, stop, event) ~ M + dose, list(M ~ dose), id = \"subject\", data = simdata, boot.n = 500) # The dose effect on mediator response: dose.on.mediator <- effect(dose ~ M, s) ggplot.effect(dose.on.mediator) # direct effect of dose on outcome direct <- effect(dose ~ outcome, s) ggplot.effect(direct) # effect of mediator on outcome mediator.on.outcome <- effect(M ~ outcome, s) ggplot.effect(mediator.on.outcome)"},{"path":"http://opensource.nibr.com/dpasurv/articles/dpa.html","id":"explore-output-of-aalens-additive-model","dir":"Articles","previous_headings":"4. Simulated Use Case","what":"Explore output of Aalen’s additive model","title":"The dpasurv package","text":"output object call dpa() function stores output Aalen’s additive model (1) can explore content inferential purposes According resampling tests time-varying effects see mediator effect indeed significantly different zero well high-dose effect, low-dose effect marginally significant.","code":"# Output from Aalen's additive model from the timereg::aalen() implementation: summary(s$aalen) #> Additive Aalen Model #> #> Test for nonparametric terms #> #> Test for non-significant effects #> Supremum-test of significance p-value H_0: B(t)=0 #> (Intercept) 2.56 0.163 #> M 3.30 0.025 #> doselow 2.99 0.061 #> dosehigh 5.12 0.000 #> #> Test for time invariant effects #> Kolmogorov-Smirnov test p-value H_0:constant effect #> (Intercept) 1.400 0.023 #> M 0.176 0.066 #> doselow 0.595 0.473 #> dosehigh 0.587 0.534 #> Cramer von Mises test p-value H_0:constant effect #> (Intercept) 148.00 0.008 #> M 2.05 0.072 #> doselow 14.90 0.530 #> dosehigh 13.30 0.623 #> #> #> #> Call: #> timereg::aalen(formula = out.formula, data = data, id = data[[id]])"},{"path":"http://opensource.nibr.com/dpasurv/articles/dpa.html","id":"plot-the-direct-indirect-and-total-effects","dir":"Articles","previous_headings":"4. Simulated Use Case","what":"Plot the direct, indirect, and total effects","title":"The dpasurv package","text":"Finally, let’s also calculate indirect total effects plot together direct, indirect, total effects: see indirect effect dose survival neutral first 100 days becomes detrimental survival (significant high dose). detrimental indirect effect high dose counteracts corresponding significant beneficial direct effect.","code":"# indirect effect of dose on outcome, mediated through M indirect <- effect(dose ~ M ~ outcome, s) # total effect total <- sum(direct, indirect) ggplot.effect(list(direct, indirect, total))"},{"path":"http://opensource.nibr.com/dpasurv/articles/ggplot_demo.html","id":"load-data-and-run-analysis","dir":"Articles","previous_headings":"","what":"Load data and run analysis","title":"ggplot plotting functionality","text":"","code":"data(simdata) set.seed(1) # Perform dynamic path analysis s <- dpa(Surv(start,stop,event)~M+x, list(M~x), id=\"subject\", data=simdata, boot.n=500) # Calculate direct, indirect and total effects direct <- effect(x ~ outcome, s) indirect <- effect(x ~ M ~ outcome, s) total <- sum(direct, indirect) # Perform dynamic path analysis under multiple treatment arms: s2 <- dpa(Surv(start,stop,event)~M+dose, list(M~dose), id=\"subject\", data=simdata, boot.n=500) # Calculate corresponding direct, indirect and total effects direct2 <- effect(dose ~ outcome, s2) indirect2 <- effect(dose ~ M ~ outcome, s2) total2 <- sum(direct2, indirect2)"},{"path":[]},{"path":"http://opensource.nibr.com/dpasurv/articles/ggplot_demo.html","id":"single-arm","dir":"Articles","previous_headings":"Basic plotting functionality","what":"Single arm","title":"ggplot plotting functionality","text":"","code":"par(mfrow=c(1,3)) plot(direct) plot(indirect); abline(h=0, lty=2, col=2) plot(total); abline(h=0, lty=2, col=2)"},{"path":"http://opensource.nibr.com/dpasurv/articles/ggplot_demo.html","id":"multiple-arm","dir":"Articles","previous_headings":"Basic plotting functionality","what":"Multiple arm","title":"ggplot plotting functionality","text":"","code":"par(mfrow=c(2,3)) plot(direct2); abline(h=0, lty=2, col=2) plot(indirect2); abline(h=0, lty=2, col=2) plot(total2); abline(h=0, lty=2, col=2)"},{"path":"http://opensource.nibr.com/dpasurv/articles/ggplot_demo.html","id":"ggplot-plotting-functionality","dir":"Articles","previous_headings":"","what":"ggplot plotting functionality","title":"ggplot plotting functionality","text":"can input object type “effect” Alternatively, can provide list “effect” objects, example Different dose levels plotted top Also works plot list “effect” objects possible customize plotting parameters, example","code":"ggplot.effect(indirect) ggplot.effect(list(direct, indirect, total)) ggplot.effect(direct2) ggplot.effect(list(direct2, indirect2, total2)) ggplot.effect(list(direct, indirect, total), titles = c(\"Direct\",\"Indirect\",\"Total\"), x_label = \"Time (in years)\", y_label = \"Custom y-label\")"},{"path":"http://opensource.nibr.com/dpasurv/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Novartis Pharma AG. Copyright holder. Matthias Kormaksson. Author, maintainer. Susanne Strohmaier. Author. Markus Lange. Author. David Demanse. Author.","code":""},{"path":"http://opensource.nibr.com/dpasurv/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Kormaksson M, Lange M, Demanse D, Strohmaier S, Duan J, Xie Q, Carbini M, Bossen C, Guettner , Maniero (2024). “Dynamic path analysis exploring treatment effect mediation processes clinical trials time--event endpoints.” Statistics Medicine (Accepted).","code":"@Article{, title = {Dynamic path analysis for exploring treatment effect mediation processes in clinical trials with time-to-event endpoints}, author = {Matthias Kormaksson and Markus Lange and David Demanse and Susanne Strohmaier and Jiawei Duan and Qing Xie and Mariana Carbini and Claudia Bossen and Achim Guettner and Antonella Maniero}, journal = {Statistics in Medicine (Accepted)}, year = {2024}, }"},{"path":"http://opensource.nibr.com/dpasurv/index.html","id":"dpasurv","dir":"","previous_headings":"","what":"Dynamic Path Analysis of Survival Data via Aalen's Additive Hazards Model","title":"Dynamic Path Analysis of Survival Data via Aalen's Additive Hazards Model","text":"R-package Dynamic Path Analysis survival data.","code":""},{"path":"http://opensource.nibr.com/dpasurv/index.html","id":"overview","dir":"","previous_headings":"","what":"Overview","title":"Dynamic Path Analysis of Survival Data via Aalen's Additive Hazards Model","text":"dpasurv package designed perform dynamic path analysis via calls following principal functions: dpa() fits dynamic path models corresponding given dynamic path diagram; returns object class dpa effect() estimates cumulative direct indirect effects fitted dpa-object; returns object class effect effect-objects can summed together obtain total effect (.e. direct effect + indirect effect) well plotted bootstrap confidence intervals.","code":""},{"path":"http://opensource.nibr.com/dpasurv/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Dynamic Path Analysis of Survival Data via Aalen's Additive Hazards Model","text":"","code":"# 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\")"},{"path":"http://opensource.nibr.com/dpasurv/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Dynamic Path Analysis of Survival Data via Aalen's Additive Hazards Model","text":"vignette use dpasurv package can found , basic usage summarized :","code":"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))"},{"path":"http://opensource.nibr.com/dpasurv/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Dynamic Path Analysis of Survival Data via Aalen's Additive Hazards Model","text":"dpasurv package created supplementary code following manuscript: publish results obtained dpasurv package, please cite paper.","code":"@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}, }"},{"path":"http://opensource.nibr.com/dpasurv/index.html","id":"code-authors","dir":"","previous_headings":"","what":"Code authors","title":"Dynamic Path Analysis of Survival Data via Aalen's Additive Hazards Model","text":"Matthias Kormaksson, matthias-1.kormaksson_ext@novartis.com (maintainer) Susanne Strohmaier, susanne.strohmaier@meduniwien.ac.Markus Lange, markus.lange@novartis.com David Demanse, david.demanse@novartis.com","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/Areg.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal Aalen's Additive Hazards Model storing a linear effect estimate for each event time — Areg","title":"Internal Aalen's Additive Hazards Model storing a linear effect estimate for each event time — Areg","text":"call function ","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/Areg.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal Aalen's Additive Hazards Model storing a linear effect estimate for each event time — Areg","text":"","code":"Areg(out.formula, id, data, method, ...)"},{"path":"http://opensource.nibr.com/dpasurv/reference/Areg.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal Aalen's Additive Hazards Model storing a linear effect estimate for each event time — Areg","text":".formula Survival formula Aalen's additive hazards model. id character string indicating column 'data' corresponds subject ID. data Data set counting process format. particular data contain \"start\", \"stop\" \"event\" column along mediators baseline covariates. method passed dpa call, defaults \"timereg\", otherwise \"aareg\" ... parameters passed Aalen's additive hazards regression function \"timereg::aalen()\"","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/Areg.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Internal Aalen's Additive Hazards Model storing a linear effect estimate for each event time — Areg","text":"data.frame observation times estimated coefficients independent variables \"regformula\"","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/Areg.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Internal Aalen's Additive Hazards Model storing a linear effect estimate for each event time — Areg","text":"","code":"library(dpasurv) data(simdata) obj <- Areg(Surv(start,stop,event)~M+x, id=\"subject\", data=simdata, method=\"timereg\")"},{"path":"http://opensource.nibr.com/dpasurv/reference/Mreg.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal mediator regression function storing a linear regression estimate for each event time — Mreg","title":"Internal mediator regression function storing a linear regression estimate for each event time — Mreg","text":"call function ","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/Mreg.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal mediator regression function storing a linear regression estimate for each event time — Mreg","text":"","code":"Mreg(regformula, obstimes, startt, stopt, event, mediator, dataset, w = 1)"},{"path":"http://opensource.nibr.com/dpasurv/reference/Mreg.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal mediator regression function storing a linear regression estimate for each event time — Mreg","text":"regformula independent variable input standard lm fuction R obstimes observed event times Aalen's additive model estimated via function Areg startt start time observation intervals stopt end time observation intervals (actual event times) event event indicator mediator mediator interest dataset dataset (counting process format) w (optional) weights (actually used default implementation dynamic path analysis, set 1)","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/Mreg.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Internal mediator regression function storing a linear regression estimate for each event time — Mreg","text":"data.frame observation times estimated coefficients independent variables \"regformula\"","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/Mreg.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Internal mediator regression function storing a linear regression estimate for each event time — Mreg","text":"","code":"library(dpasurv) data(simdata) obj <- Mreg(~x, sort(simdata$stop[simdata$event==1]), \"start\", \"stop\", \"event\", \"M\", simdata)"},{"path":"http://opensource.nibr.com/dpasurv/reference/Surv.html","id":null,"dir":"Reference","previous_headings":"","what":"A wrapper function for survival::Surv — Surv","title":"A wrapper function for survival::Surv — Surv","text":"wrapper function survival::Surv","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/Surv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A wrapper function for survival::Surv — Surv","text":"","code":"Surv(...)"},{"path":"http://opensource.nibr.com/dpasurv/reference/Surv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A wrapper function for survival::Surv — Surv","text":"... parameters passed survival::Surv","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/Surv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"A wrapper function for survival::Surv — Surv","text":"object class survival::Surv","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/Surv.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"A wrapper function for survival::Surv — Surv","text":"","code":"library(dpasurv) data(simdata) survival.obj <- Surv(simdata$start, simdata$stop, simdata$event)"},{"path":"http://opensource.nibr.com/dpasurv/reference/add.ci.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate bootstrap confidence bands for effect of interest — add.ci","title":"Calculate bootstrap confidence bands for effect of interest — add.ci","text":"Calculate bootstrap confidence bands effect interest","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/add.ci.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate bootstrap confidence bands for effect of interest — add.ci","text":"","code":"add.ci(object, alpha)"},{"path":"http://opensource.nibr.com/dpasurv/reference/add.ci.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate bootstrap confidence bands for effect of interest — add.ci","text":"object object class \"effect\" alpha confidence level","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/add.ci.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate bootstrap confidence bands for effect of interest — add.ci","text":"object class \"effect\" updated confidence interval corresponding alpha","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/add.ci.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate bootstrap confidence bands for effect of interest — add.ci","text":"","code":"library(dpasurv) data(simdata) # Perform dynamic path analysis: # We set boot.n=30 for the example to run fast, should be set large enough # so that results don't change meaningfully for different seeds. s <- dpa(Surv(start,stop,event)~M+x, list(M~x), id=\"subject\", data=simdata, boot.n=30) # Calculate cumulative direct effect (which calculates a CI with alpha = 0.05 by default): direct <- effect(x ~ outcome, s) # update confidence interval for a new alpha (this overwrites the 0.05 CI already calculated above) direct <- add.ci(direct, alpha=0.10)"},{"path":"http://opensource.nibr.com/dpasurv/reference/check.dag.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal check of whether the formulas passed to the function dpa follow a directed acyclic graph (DAG) — check.dag","title":"Internal check of whether the formulas passed to the function dpa follow a directed acyclic graph (DAG) — check.dag","text":"call function ","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/check.dag.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal check of whether the formulas passed to the function dpa follow a directed acyclic graph (DAG) — check.dag","text":"","code":"check.dag(meta, data)"},{"path":"http://opensource.nibr.com/dpasurv/reference/check.dag.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal check of whether the formulas passed to the function dpa follow a directed acyclic graph (DAG) — check.dag","text":"meta meta data obtained internally inside dpasurv::dpa function data input data dpasurv::dpa function","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/check.dag.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Internal check of whether the formulas passed to the function dpa follow a directed acyclic graph (DAG) — check.dag","text":"function return anything","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/check.dag.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Internal check of whether the formulas passed to the function dpa follow a directed acyclic graph (DAG) — check.dag","text":"","code":"library(dpasurv) data(simdata) meta <- get.meta(Surv(start, stop, event) ~ x + M, list(M ~ x), simdata) check.dag(meta, simdata)"},{"path":"http://opensource.nibr.com/dpasurv/reference/dpa.html","id":null,"dir":"Reference","previous_headings":"","what":"Dynamic Path Analysis — dpa","title":"Dynamic Path Analysis — dpa","text":"Dynamic Path Analysis","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/dpa.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Dynamic Path Analysis — dpa","text":"","code":"dpa( out.formula, mediator.formulas, id, data, boot.n = 200, method = \"timereg\", progress_bar = FALSE, ... )"},{"path":"http://opensource.nibr.com/dpasurv/reference/dpa.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Dynamic Path Analysis — dpa","text":".formula Survival formula Aalen's additive hazards model. mediator.formulas Mediator regression formula (case single mediator), list regression formulas (case multiple mediators). formulas must ordered according Directed Acyclic Graph Structure (see Details). id character string indicating column 'data' corresponds subject ID. Bootstrapping performed id. data Data set counting process format. particular data contain \"start\", \"stop\" \"event\" column along mediators baseline covariates. boot.n Number bootstrap samples. method underlying implementation Aalen's additive regression model. Defaults \"timereg\", relies timereg::aalen() implementation, method = \"aareg\" uses survival::aareg() implementation. progress_bar Boolean. TRUE, show progress bar. Defaults FALSE. ... parameters passed Aalen's additive hazards model implementation. method = \"timereg\", ... passed timereg::aalen(), method = \"aareg\", ... passed survival::aareg(). ... contains parameters belong formalArgs corresponding implementation parameters ignored.","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/dpa.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Dynamic Path Analysis — dpa","text":"Object class `dpa` following fields: coefs list estimated coefficients regressions listed .formula mediator.formulas. boot.coefs list bootstrap estimates corresponding coefs. stores bootstrap estimates facilitate calculation direct, indirect total effects along bootstrap confidence intervals. meta list keeping track responses covariates .formula mediator.formulas. Also keeps track variable types level names case factors. aalen Object storing information pertaining Aalen's additive model fit. Object class \"aalen\" method=\"timereg\", class \"aareg\" method=\"aareg\".","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/dpa.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Dynamic Path Analysis — dpa","text":"dpa performs Dynamic Path Analysis Directed Acyclic Graph (DAG). .formula can covariates mediators listed mediator.formulas. mediator.formulas must obey following DAG structure rule: response k-th formula appear covariate formulas k+1, ..., length(mediator.formulas).","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/dpa.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Dynamic Path Analysis — dpa","text":"","code":"library(dpasurv) data(simdata) set.seed(1) # Perform dynamic path analysis: # We set boot.n=30 for the example to run fast, should be set large enough # so that results don't change meaningfully for different seeds. s <- dpa(Surv(start,stop,event)~M+x, list(M~x), id=\"subject\", data=simdata, boot.n=30) # Calculate cumulative direct, indirect, and total effects: direct <- effect(x ~ outcome, s) indirect <- effect(x ~ M ~ outcome, s) total <- sum(direct, indirect) # Plot the effects using basic graphics: 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 effects using ggplot2 graphics: ggplot.effect(list(direct, indirect, total))"},{"path":"http://opensource.nibr.com/dpasurv/reference/effect.html","id":null,"dir":"Reference","previous_headings":"","what":"Effect estimation in dynamic path analysis — effect","title":"Effect estimation in dynamic path analysis — effect","text":"effect estimation method class \"dpa\"","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/effect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Effect estimation in dynamic path analysis — effect","text":"","code":"effect(formula, object, alpha = 0.05)"},{"path":"http://opensource.nibr.com/dpasurv/reference/effect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Effect estimation in dynamic path analysis — effect","text":"formula formula direct indirect effect estimated. form: covariate ~ outcome direct effect covariate outcome, form: covariate ~ mediator ~ outcome indirect effect covariate outcome mediated mediator. Note word \"outcome\" reserved survival outcome process, word \"covariate\" \"mediator\" match corresponding variable name data input. Alternatively form can : covariate ~ mediator direct effects covariate mediator, : covariate ~ mediator1 ~ mediator2 indirect effects covariate mediator2 mediated mediator1. object object class \"dpa\" (obtained calling function dpa) effect estimated. alpha confidence level bootstrap intervals","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/effect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Effect estimation in dynamic path analysis — effect","text":"object class \"effect\" following fields: coefs data.frame containing unique event times along calculated effect coefficients. effects corresponding continuous variable results single effect column. factors n.levels categories data.frame contains n.levels-1 effect columns representing effect coefficient particular factor level (compared reference level). lower data.frame dimension coefs containing lower confidence bands effects stored coefs upper data.frame dimension coefs containing upper confidence bands effects stored coefs boot.coefs data.frame three columns: one column bootstrap sample ID, second column unique event times (per bootstrap sample), third column estimated effect coefficients (per bootstrap sample). storing effects per bootstrap sample facilitates calculation bootstrap confidence intervals sums indirect direct effects. label effect label path specification: \"direct\" direct effect \"indirect\" indirect effect mediated path mediator(s) scale scale effect coefficients coefs, lower, upper: \"cumulative\" (effects outcome) \"identity\" (effects mediators) alpha confidence level bootstrap intervals","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/effect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Effect estimation in dynamic path analysis — effect","text":"","code":"library(dpasurv) data(simdata) set.seed(1) # Perform dynamic path analysis: # We set boot.n=30 for the example to run fast, should be set large enough # so that results don't change meaningfully for different seeds. s <- dpa(Surv(start,stop,event)~M+x, list(M~x), id=\"subject\", data=simdata, boot.n=30) direct <- effect(x ~ outcome, s) indirect <- effect(x ~ M ~ outcome, s) total <- sum(direct, indirect)"},{"path":"http://opensource.nibr.com/dpasurv/reference/find.variables.html","id":null,"dir":"Reference","previous_headings":"","what":"Find variables of a given formula — find.variables","title":"Find variables of a given formula — find.variables","text":"call function ","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/find.variables.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find variables of a given formula — find.variables","text":"","code":"find.variables(formula)"},{"path":"http://opensource.nibr.com/dpasurv/reference/find.variables.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find variables of a given formula — find.variables","text":"formula","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/find.variables.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find variables of a given formula — find.variables","text":"character vector formula's variable names","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/find.variables.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find variables of a given formula — find.variables","text":"","code":"library(dpasurv) data(simdata) vars <- find.variables(x ~ outcome)"},{"path":"http://opensource.nibr.com/dpasurv/reference/get.meta.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal function that gathers meta data on the input to function dpa — get.meta","title":"Internal function that gathers meta data on the input to function dpa — get.meta","text":"call function ","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/get.meta.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal function that gathers meta data on the input to function dpa — get.meta","text":"","code":"get.meta(out.formula, mediator.formulas, data)"},{"path":"http://opensource.nibr.com/dpasurv/reference/get.meta.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal function that gathers meta data on the input to function dpa — get.meta","text":".formula Survival formula Aalen's additive hazards model. mediator.formulas list mediator regression formulas. data Data set counting process format. particular data contain \"start\", \"stop\" \"event\" column along mediators baseline covariates.","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/get.meta.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Internal function that gathers meta data on the input to function dpa — get.meta","text":"function returns meta data associated call dpasurv::dpa","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/get.meta.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Internal function that gathers meta data on the input to function dpa — get.meta","text":"","code":"library(dpasurv) data(simdata) meta <- get.meta(Surv(start, stop, event) ~ x + M, list(M ~ x), simdata)"},{"path":"http://opensource.nibr.com/dpasurv/reference/ggplot.effect.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot effects from dynamic path analysis along with bootstrap confidence bands — ggplot.effect","title":"Plot effects from dynamic path analysis along with bootstrap confidence bands — ggplot.effect","text":"plotting method class \"effect\"","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/ggplot.effect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot effects from dynamic path analysis along with bootstrap confidence bands — ggplot.effect","text":"","code":"ggplot.effect( object, relative = FALSE, titles = NULL, x_label = \"Time\", y_label = NULL )"},{"path":"http://opensource.nibr.com/dpasurv/reference/ggplot.effect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot effects from dynamic path analysis along with bootstrap confidence bands — ggplot.effect","text":"object object class \"effect\", list objects class \"effect\" relative effect plotted relative survival scale (.e. `y=exp(-effect)`)?. Defaults FALSE. titles NULL, function automatically generate. Otherwise character vector length equal number elements object list x_label Label x-axis. Defaults \"Time\" y_label Label y-axis. Default object scale \"cumulative\" \"Cumulative Effect\" (relative=FALSE) \"Relative survival\" (relative=TRUE). object scale \"identity\" default y_label \"Effect\".","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/ggplot.effect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot effects from dynamic path analysis along with bootstrap confidence bands — ggplot.effect","text":"ggplot object","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/ggplot.effect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot effects from dynamic path analysis along with bootstrap confidence bands — ggplot.effect","text":"","code":"library(dpasurv) data(simdata) set.seed(1) # Perform dynamic path analysis: # We set boot.n=30 for the example to run fast, should be set large enough # so that results don't change meaningfully for different seeds. s <- dpa(Surv(start,stop,event)~M+x, list(M~x), id=\"subject\", data=simdata, boot.n=30) direct <- effect(x ~ outcome, s) indirect <- effect(x ~ M ~ outcome, s) total <- sum(direct, indirect) ggplot.effect(direct) ggplot.effect(list(direct, indirect, total))"},{"path":"http://opensource.nibr.com/dpasurv/reference/plot.effect.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot effects from dynamic path analysis along with bootstrap confidence bands — plot.effect","title":"Plot effects from dynamic path analysis along with bootstrap confidence bands — plot.effect","text":"plotting method class \"effect\"","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/plot.effect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot effects from dynamic path analysis along with bootstrap confidence bands — plot.effect","text":"","code":"# S3 method for class 'effect' plot(x, relative = FALSE, ...)"},{"path":"http://opensource.nibr.com/dpasurv/reference/plot.effect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot effects from dynamic path analysis along with bootstrap confidence bands — plot.effect","text":"x object class \"effect\" relative effect plotted relative survival scale (.e. `y=exp(-effect)`)?. Defaults FALSE. ... graphical parameters passed graphics::plot function.","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/plot.effect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot effects from dynamic path analysis along with bootstrap confidence bands — plot.effect","text":"","code":"library(dpasurv) data(simdata) set.seed(1) # Perform dynamic path analysis: # We set boot.n=30 for the example to run fast, should be set large enough # so that results don't change meaningfully for different seeds. s <- dpa(Surv(start,stop,event)~M+x, list(M~x), id=\"subject\", data=simdata, boot.n=30) direct <- effect(x ~ outcome, s) indirect <- effect(x ~ M ~ outcome, s) total <- sum(direct, indirect) 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)"},{"path":"http://opensource.nibr.com/dpasurv/reference/simdata.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulated data — simdata","title":"Simulated data — simdata","text":"simulated data set (start,stop] format. subject column refers subject ID note multiple rows per subject. columns x dose correspond treatment dose variable respectively, M refers longitudinal mediator values. triplet (start, stop, event) corresponds time--event data required (start,stop] format.","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/simdata.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Simulated data — simdata","text":"data frame following variables: subject (fct), x (dbl), dose (fct), M (dbl), start (dbl), stop (dbl), event (dbl).","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/sum.effect.html","id":null,"dir":"Reference","previous_headings":"","what":"Sum of direct and indirect effects from dynamic path analysis — sum.effect","title":"Sum of direct and indirect effects from dynamic path analysis — sum.effect","text":"sum method class \"effect\"","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/sum.effect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sum of direct and indirect effects from dynamic path analysis — sum.effect","text":"","code":"# S3 method for class 'effect' sum(effect1, effect2, ...)"},{"path":"http://opensource.nibr.com/dpasurv/reference/sum.effect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sum of direct and indirect effects from dynamic path analysis — sum.effect","text":"effect1 object class \"effect\" obtained call function effect() effect2 second object class \"effect\" obtained call function effect() ... additional objects class \"effect\" (number effects allowed)","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/sum.effect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Sum of direct and indirect effects from dynamic path analysis — sum.effect","text":"object class \"effect\" containing sum effect1, effect2, ...","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/sum.effect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Sum of direct and indirect effects from dynamic path analysis — sum.effect","text":"","code":"library(dpasurv) data(simdata) set.seed(1) # Perform dynamic path analysis: # We set boot.n=30 for the example to run fast, should be set large enough # so that results don't change meaningfully for different seeds. s <- dpa(Surv(start,stop,event)~M+x, list(M~x), id=\"subject\", data=simdata, boot.n=30) direct <- effect(x ~ outcome, s) indirect <- effect(x ~ M ~ outcome, s) total <- sum(direct, indirect)"},{"path":"http://opensource.nibr.com/dpasurv/news/index.html","id":"dpasurv-010","dir":"Changelog","previous_headings":"","what":"dpasurv 0.1.0","title":"dpasurv 0.1.0","text":"Added NEWS.md file track changes package.","code":""}] +[{"path":"http://opensource.nibr.com/dpasurv/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 Novartis Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"http://opensource.nibr.com/dpasurv/articles/dpa.html","id":"introduction","dir":"Articles","previous_headings":"","what":"1. Introduction","title":"The dpasurv package","text":"Dynamic path analysis introduced (Fosen et al. 2006) method performing mediation analysis longitudinal mediator time--event outcome. thorough review methodology can found tutorial paper (Kormaksson et al. 2024). vignette outline modeling framework define direct, indirect total effects context dynamic path analysis. demonstrate main functionalities package, namely estimation, inference, visualization.","code":""},{"path":[]},{"path":"http://opensource.nibr.com/dpasurv/articles/dpa.html","id":"dynamic-path-analysis","dir":"Articles","previous_headings":"2. Methods","what":"Dynamic path analysis","title":"The dpasurv package","text":"Dynamic path analysis involves modeling -called dynamic path diagrams one depicted Figure 1 (). dynamic path diagram defined (Fosen et al. 2006) time-indexed sequence directed acyclic graphs characterized treatment variable, ZZ, one longitudinal mediator variables, M(t)M(t), survival (time--event) outcome dN(t)=1(t≤T # A tibble: 1,229 × 7 #> subject x dose M start stop event #> #> 1 1 0 ctrl 6.74 0 4 0 #> 2 1 0 ctrl 6.91 4 8 0 #> 3 1 0 ctrl 6.9 8 12 0 #> 4 1 0 ctrl 6.71 12 26 0 #> 5 1 0 ctrl 6.45 26 46.8 1 #> 6 2 1 high 6.11 0 4 0 #> 7 2 1 high 6.28 4 8 0 #> 8 2 1 high 7.04 8 12 0 #> 9 2 1 high 6.93 12 26 0 #> 10 2 1 high 7.86 26 52 0 #> # ℹ 1,219 more rows"},{"path":"http://opensource.nibr.com/dpasurv/articles/dpa.html","id":"implementation-in-a-nutshell","dir":"Articles","previous_headings":"3. Getting started with dpasurv","what":"Implementation in a nutshell","title":"The dpasurv package","text":"see minimal code required performing dynamic path analysis simdata. explores direct effect treatment x survival well indirect effect mediated M:","code":"# Perform dynamic path analysis s <- dpa(Surv(start, stop, event) ~ M + x, list(M ~ x), id = \"subject\", data = simdata, boot.n = 500) # Extract cumulative direct and indirect effects with 95% pointwise bootstrap confidence bands: direct <- effect(x ~ outcome, s, alpha=0.05) indirect <- effect(x ~ M ~ outcome, s, alpha=0.05) # Use sum() method to obtain total effect 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))"},{"path":"http://opensource.nibr.com/dpasurv/articles/dpa.html","id":"simulated-use-case","dir":"Articles","previous_headings":"","what":"4. Simulated Use Case","title":"The dpasurv package","text":"Let us now use dpasurv package perform slightly depth analysis simdata.","code":""},{"path":"http://opensource.nibr.com/dpasurv/articles/dpa.html","id":"look-at-the-data","dir":"Articles","previous_headings":"4. Simulated Use Case","what":"Look at the data","title":"The dpasurv package","text":"Firstly, note dose response trend looking longitudinal trends subject mediator profiles: higher dose, higher average mediator value . also note dose response trend looking association dose levels survival Cox model dose mediator covariates reveals significant hazard ratio high dose, trend low dose (compared control), significant association mediator survival:","code":"ggplot(mapping=aes(x = start, y = M, group=dose), data=simdata) + geom_smooth(aes(colour=dose)) fit <- survival::survfit(Surv(start, stop, event) ~ dose, data=simdata) plot(fit, col=2:4, xlab=\"Time\", ylab=\"Survival\", main=\"KM-curves by dose level\") legend(150, 1, c(\"control\", \"low dose\", \"high dose\"), col=2:4, lwd=2, bty='n') summary(survival::coxph(Surv(start, stop, event) ~ dose + M, data=simdata)) #> Call: #> survival::coxph(formula = Surv(start, stop, event) ~ dose + M, #> data = simdata) #> #> n= 1229, number of events= 172 #> #> coef exp(coef) se(coef) z Pr(>|z|) #> doselow -0.32281 0.72411 0.18826 -1.715 0.08640 . #> dosehigh -0.66230 0.51566 0.20542 -3.224 0.00126 ** #> M 0.05274 1.05416 0.04863 1.085 0.27808 #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> #> exp(coef) exp(-coef) lower .95 upper .95 #> doselow 0.7241 1.3810 0.5007 1.0473 #> dosehigh 0.5157 1.9392 0.3448 0.7713 #> M 1.0542 0.9486 0.9583 1.1596 #> #> Concordance= 0.555 (se = 0.025 ) #> Likelihood ratio test= 10.57 on 3 df, p=0.01 #> Wald test = 10.51 on 3 df, p=0.01 #> Score (logrank) test = 10.7 on 3 df, p=0.01"},{"path":"http://opensource.nibr.com/dpasurv/articles/dpa.html","id":"dynamic-path-analysis-1","dir":"Articles","previous_headings":"4. Simulated Use Case","what":"Dynamic path analysis","title":"The dpasurv package","text":"Let’s now perform dynamic path analysis dpa() function calculate effects interest effect() function. confirm dose response mediator, appears significant high-dose vs control: also confirm dose response survival outcome, although high-dose appears significant: contrast conclusions Cox-model appears meaningful dynamic association mediator survival: particular, mediator effect neutral first 100 days starts significant detrimental effect survival (higher mediator value, higher risk).","code":"set.seed(1) s <- dpa(Surv(start, stop, event) ~ M + dose, list(M ~ dose), id = \"subject\", data = simdata, boot.n = 500) # The dose effect on mediator response: dose.on.mediator <- effect(dose ~ M, s) ggplot.effect(dose.on.mediator) # direct effect of dose on outcome direct <- effect(dose ~ outcome, s) ggplot.effect(direct) # effect of mediator on outcome mediator.on.outcome <- effect(M ~ outcome, s) ggplot.effect(mediator.on.outcome)"},{"path":"http://opensource.nibr.com/dpasurv/articles/dpa.html","id":"explore-output-of-aalens-additive-model","dir":"Articles","previous_headings":"4. Simulated Use Case","what":"Explore output of Aalen’s additive model","title":"The dpasurv package","text":"output object call dpa() function stores output Aalen’s additive model (1) can explore content inferential purposes According resampling tests time-varying effects see mediator effect indeed significantly different zero well high-dose effect, low-dose effect marginally significant.","code":"# Output from Aalen's additive model from the timereg::aalen() implementation: summary(s$aalen) #> Additive Aalen Model #> #> Test for nonparametric terms #> #> Test for non-significant effects #> Supremum-test of significance p-value H_0: B(t)=0 #> (Intercept) 2.56 0.163 #> M 3.30 0.025 #> doselow 2.99 0.061 #> dosehigh 5.12 0.000 #> #> Test for time invariant effects #> Kolmogorov-Smirnov test p-value H_0:constant effect #> (Intercept) 1.400 0.023 #> M 0.176 0.066 #> doselow 0.595 0.473 #> dosehigh 0.587 0.534 #> Cramer von Mises test p-value H_0:constant effect #> (Intercept) 148.00 0.008 #> M 2.05 0.072 #> doselow 14.90 0.530 #> dosehigh 13.30 0.623 #> #> #> #> Call: #> timereg::aalen(formula = out.formula, data = data, id = data[[id]])"},{"path":"http://opensource.nibr.com/dpasurv/articles/dpa.html","id":"plot-the-direct-indirect-and-total-effects","dir":"Articles","previous_headings":"4. Simulated Use Case","what":"Plot the direct, indirect, and total effects","title":"The dpasurv package","text":"Finally, let’s also calculate indirect total effects plot together direct, indirect, total effects: see indirect effect dose survival neutral first 100 days becomes detrimental survival (significant high dose). detrimental indirect effect high dose counteracts corresponding significant beneficial direct effect.","code":"# indirect effect of dose on outcome, mediated through M indirect <- effect(dose ~ M ~ outcome, s) # total effect total <- sum(direct, indirect) ggplot.effect(list(direct, indirect, total))"},{"path":"http://opensource.nibr.com/dpasurv/articles/ggplot_demo.html","id":"load-data-and-run-analysis","dir":"Articles","previous_headings":"","what":"Load data and run analysis","title":"ggplot plotting functionality","text":"","code":"data(simdata) set.seed(1) # Perform dynamic path analysis s <- dpa(Surv(start,stop,event)~M+x, list(M~x), id=\"subject\", data=simdata, boot.n=500) # Calculate direct, indirect and total effects direct <- effect(x ~ outcome, s) indirect <- effect(x ~ M ~ outcome, s) total <- sum(direct, indirect) # Perform dynamic path analysis under multiple treatment arms: s2 <- dpa(Surv(start,stop,event)~M+dose, list(M~dose), id=\"subject\", data=simdata, boot.n=500) # Calculate corresponding direct, indirect and total effects direct2 <- effect(dose ~ outcome, s2) indirect2 <- effect(dose ~ M ~ outcome, s2) total2 <- sum(direct2, indirect2)"},{"path":[]},{"path":"http://opensource.nibr.com/dpasurv/articles/ggplot_demo.html","id":"single-arm","dir":"Articles","previous_headings":"Basic plotting functionality","what":"Single arm","title":"ggplot plotting functionality","text":"","code":"par(mfrow=c(1,3)) plot(direct) plot(indirect); abline(h=0, lty=2, col=2) plot(total); abline(h=0, lty=2, col=2)"},{"path":"http://opensource.nibr.com/dpasurv/articles/ggplot_demo.html","id":"multiple-arm","dir":"Articles","previous_headings":"Basic plotting functionality","what":"Multiple arm","title":"ggplot plotting functionality","text":"","code":"par(mfrow=c(2,3)) plot(direct2); abline(h=0, lty=2, col=2) plot(indirect2); abline(h=0, lty=2, col=2) plot(total2); abline(h=0, lty=2, col=2)"},{"path":"http://opensource.nibr.com/dpasurv/articles/ggplot_demo.html","id":"ggplot-plotting-functionality","dir":"Articles","previous_headings":"","what":"ggplot plotting functionality","title":"ggplot plotting functionality","text":"can input object type “effect” Alternatively, can provide list “effect” objects, example Different dose levels plotted top Also works plot list “effect” objects possible customize plotting parameters, example","code":"ggplot.effect(indirect) ggplot.effect(list(direct, indirect, total)) ggplot.effect(direct2) ggplot.effect(list(direct2, indirect2, total2)) ggplot.effect(list(direct, indirect, total), titles = c(\"Direct\",\"Indirect\",\"Total\"), x_label = \"Time (in years)\", y_label = \"Custom y-label\")"},{"path":"http://opensource.nibr.com/dpasurv/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Novartis Pharma AG. Copyright holder. Matthias Kormaksson. Author, maintainer. Susanne Strohmaier. Author. Markus Lange. Author. David Demanse. Author.","code":""},{"path":"http://opensource.nibr.com/dpasurv/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Kormaksson M, Lange M, Demanse D, Strohmaier S, Duan J, Xie Q, Carbini M, Bossen C, Guettner , Maniero (2024). “Dynamic path analysis exploring treatment effect mediation processes clinical trials time--event endpoints.” Statistics Medicine (Accepted).","code":"@Article{, title = {Dynamic path analysis for exploring treatment effect mediation processes in clinical trials with time-to-event endpoints}, author = {Matthias Kormaksson and Markus Lange and David Demanse and Susanne Strohmaier and Jiawei Duan and Qing Xie and Mariana Carbini and Claudia Bossen and Achim Guettner and Antonella Maniero}, journal = {Statistics in Medicine (Accepted)}, year = {2024}, }"},{"path":"http://opensource.nibr.com/dpasurv/index.html","id":"dpasurv","dir":"","previous_headings":"","what":"Dynamic Path Analysis of Survival Data via Aalen's Additive Hazards Model","title":"Dynamic Path Analysis of Survival Data via Aalen's Additive Hazards Model","text":"R-package Dynamic Path Analysis survival data.","code":""},{"path":"http://opensource.nibr.com/dpasurv/index.html","id":"overview","dir":"","previous_headings":"","what":"Overview","title":"Dynamic Path Analysis of Survival Data via Aalen's Additive Hazards Model","text":"dpasurv package designed perform dynamic path analysis via calls following principal functions: dpa() fits dynamic path models corresponding given dynamic path diagram; returns object class dpa effect() estimates cumulative direct indirect effects fitted dpa-object; returns object class effect effect-objects can summed together obtain total effect (.e. direct effect + indirect effect) well plotted bootstrap confidence intervals.","code":""},{"path":"http://opensource.nibr.com/dpasurv/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Dynamic Path Analysis of Survival Data via Aalen's Additive Hazards Model","text":"","code":"# 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\")"},{"path":"http://opensource.nibr.com/dpasurv/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Dynamic Path Analysis of Survival Data via Aalen's Additive Hazards Model","text":"vignette use dpasurv package can found , basic usage summarized :","code":"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))"},{"path":"http://opensource.nibr.com/dpasurv/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Dynamic Path Analysis of Survival Data via Aalen's Additive Hazards Model","text":"dpasurv package created supplementary code following manuscript: publish results obtained dpasurv package, please cite paper.","code":"@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}, }"},{"path":"http://opensource.nibr.com/dpasurv/index.html","id":"code-authors","dir":"","previous_headings":"","what":"Code authors","title":"Dynamic Path Analysis of Survival Data via Aalen's Additive Hazards Model","text":"Matthias Kormaksson, matthias-1.kormaksson_ext@novartis.com (maintainer) Susanne Strohmaier, susanne.strohmaier@meduniwien.ac.Markus Lange, markus.lange@novartis.com David Demanse, david.demanse@novartis.com","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/Areg.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal Aalen's Additive Hazards Model storing a linear effect estimate for each event time — Areg","title":"Internal Aalen's Additive Hazards Model storing a linear effect estimate for each event time — Areg","text":"call function ","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/Areg.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal Aalen's Additive Hazards Model storing a linear effect estimate for each event time — Areg","text":"","code":"Areg(out.formula, id, data, method, ...)"},{"path":"http://opensource.nibr.com/dpasurv/reference/Areg.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal Aalen's Additive Hazards Model storing a linear effect estimate for each event time — Areg","text":".formula Survival formula Aalen's additive hazards model. id character string indicating column 'data' corresponds subject ID. data Data set counting process format. particular data contain \"start\", \"stop\" \"event\" column along mediators baseline covariates. method passed dpa call, defaults \"timereg\", otherwise \"aareg\" ... parameters passed Aalen's additive hazards regression function \"timereg::aalen()\"","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/Areg.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Internal Aalen's Additive Hazards Model storing a linear effect estimate for each event time — Areg","text":"data.frame observation times estimated coefficients independent variables \"regformula\"","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/Areg.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Internal Aalen's Additive Hazards Model storing a linear effect estimate for each event time — Areg","text":"","code":"library(dpasurv) data(simdata) obj <- Areg(Surv(start,stop,event)~M+x, id=\"subject\", data=simdata, method=\"timereg\")"},{"path":"http://opensource.nibr.com/dpasurv/reference/Mreg.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal mediator regression function storing a linear regression estimate for each event time — Mreg","title":"Internal mediator regression function storing a linear regression estimate for each event time — Mreg","text":"call function ","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/Mreg.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal mediator regression function storing a linear regression estimate for each event time — Mreg","text":"","code":"Mreg(regformula, obstimes, startt, stopt, event, mediator, dataset, w = 1)"},{"path":"http://opensource.nibr.com/dpasurv/reference/Mreg.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal mediator regression function storing a linear regression estimate for each event time — Mreg","text":"regformula independent variable input standard lm fuction R obstimes observed event times Aalen's additive model estimated via function Areg startt start time observation intervals stopt end time observation intervals (actual event times) event event indicator mediator mediator interest dataset dataset (counting process format) w (optional) weights (actually used default implementation dynamic path analysis, set 1)","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/Mreg.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Internal mediator regression function storing a linear regression estimate for each event time — Mreg","text":"data.frame observation times estimated coefficients independent variables \"regformula\"","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/Mreg.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Internal mediator regression function storing a linear regression estimate for each event time — Mreg","text":"","code":"library(dpasurv) data(simdata) obj <- Mreg(~x, sort(simdata$stop[simdata$event==1]), \"start\", \"stop\", \"event\", \"M\", simdata)"},{"path":"http://opensource.nibr.com/dpasurv/reference/Surv.html","id":null,"dir":"Reference","previous_headings":"","what":"A wrapper function for survival::Surv — Surv","title":"A wrapper function for survival::Surv — Surv","text":"wrapper function survival::Surv","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/Surv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A wrapper function for survival::Surv — Surv","text":"","code":"Surv(...)"},{"path":"http://opensource.nibr.com/dpasurv/reference/Surv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A wrapper function for survival::Surv — Surv","text":"... parameters passed survival::Surv","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/Surv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"A wrapper function for survival::Surv — Surv","text":"object class survival::Surv","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/Surv.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"A wrapper function for survival::Surv — Surv","text":"","code":"library(dpasurv) data(simdata) survival.obj <- Surv(simdata$start, simdata$stop, simdata$event)"},{"path":"http://opensource.nibr.com/dpasurv/reference/add.ci.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate bootstrap confidence bands for effect of interest — add.ci","title":"Calculate bootstrap confidence bands for effect of interest — add.ci","text":"Calculate bootstrap confidence bands effect interest","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/add.ci.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate bootstrap confidence bands for effect of interest — add.ci","text":"","code":"add.ci(object, alpha)"},{"path":"http://opensource.nibr.com/dpasurv/reference/add.ci.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate bootstrap confidence bands for effect of interest — add.ci","text":"object object class \"effect\" alpha confidence level","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/add.ci.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate bootstrap confidence bands for effect of interest — add.ci","text":"object class \"effect\" updated confidence interval corresponding alpha","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/add.ci.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate bootstrap confidence bands for effect of interest — add.ci","text":"","code":"library(dpasurv) data(simdata) # Perform dynamic path analysis: # We set boot.n=30 for the example to run fast, should be set large enough # so that results don't change meaningfully for different seeds. s <- dpa(Surv(start,stop,event)~M+x, list(M~x), id=\"subject\", data=simdata, boot.n=30) # Calculate cumulative direct effect (which calculates a CI with alpha = 0.05 by default): direct <- effect(x ~ outcome, s) # update confidence interval for a new alpha (this overwrites the 0.05 CI already calculated above) direct <- add.ci(direct, alpha=0.10)"},{"path":"http://opensource.nibr.com/dpasurv/reference/check.dag.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal check of whether the formulas passed to the function dpa follow a directed acyclic graph (DAG) — check.dag","title":"Internal check of whether the formulas passed to the function dpa follow a directed acyclic graph (DAG) — check.dag","text":"call function ","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/check.dag.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal check of whether the formulas passed to the function dpa follow a directed acyclic graph (DAG) — check.dag","text":"","code":"check.dag(meta, data)"},{"path":"http://opensource.nibr.com/dpasurv/reference/check.dag.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal check of whether the formulas passed to the function dpa follow a directed acyclic graph (DAG) — check.dag","text":"meta meta data obtained internally inside dpasurv::dpa function data input data dpasurv::dpa function","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/check.dag.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Internal check of whether the formulas passed to the function dpa follow a directed acyclic graph (DAG) — check.dag","text":"function return anything","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/check.dag.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Internal check of whether the formulas passed to the function dpa follow a directed acyclic graph (DAG) — check.dag","text":"","code":"library(dpasurv) data(simdata) meta <- get.meta(Surv(start, stop, event) ~ x + M, list(M ~ x), simdata) check.dag(meta, simdata)"},{"path":"http://opensource.nibr.com/dpasurv/reference/dpa.html","id":null,"dir":"Reference","previous_headings":"","what":"Dynamic Path Analysis — dpa","title":"Dynamic Path Analysis — dpa","text":"Dynamic Path Analysis","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/dpa.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Dynamic Path Analysis — dpa","text":"","code":"dpa( out.formula, mediator.formulas, id, data, boot.n = 200, method = \"timereg\", progress_bar = FALSE, ... )"},{"path":"http://opensource.nibr.com/dpasurv/reference/dpa.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Dynamic Path Analysis — dpa","text":".formula Survival formula Aalen's additive hazards model. mediator.formulas Mediator regression formula (case single mediator), list regression formulas (case multiple mediators). formulas must ordered according Directed Acyclic Graph Structure (see Details). id character string indicating column 'data' corresponds subject ID. Bootstrapping performed id. data Data set counting process format. particular data contain \"start\", \"stop\" \"event\" column along mediators baseline covariates. boot.n Number bootstrap samples. method underlying implementation Aalen's additive regression model. Defaults \"timereg\", relies timereg::aalen() implementation, method = \"aareg\" uses survival::aareg() implementation. progress_bar Boolean. TRUE, show progress bar. Defaults FALSE. ... parameters passed Aalen's additive hazards model implementation. method = \"timereg\", ... passed timereg::aalen(), method = \"aareg\", ... passed survival::aareg(). ... contains parameters belong formalArgs corresponding implementation parameters ignored.","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/dpa.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Dynamic Path Analysis — dpa","text":"Object class `dpa` following fields: coefs list estimated coefficients regressions listed .formula mediator.formulas. boot.coefs list bootstrap estimates corresponding coefs. stores bootstrap estimates facilitate calculation direct, indirect total effects along bootstrap confidence intervals. meta list keeping track responses covariates .formula mediator.formulas. Also keeps track variable types level names case factors. aalen Object storing information pertaining Aalen's additive model fit. Object class \"aalen\" method=\"timereg\", class \"aareg\" method=\"aareg\".","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/dpa.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Dynamic Path Analysis — dpa","text":"dpa performs Dynamic Path Analysis Directed Acyclic Graph (DAG). .formula can covariates mediators listed mediator.formulas. mediator.formulas must obey following DAG structure rule: response k-th formula appear covariate formulas k+1, ..., length(mediator.formulas).","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/dpa.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Dynamic Path Analysis — dpa","text":"","code":"library(dpasurv) data(simdata) set.seed(1) # Perform dynamic path analysis: # We set boot.n=30 for the example to run fast, should be set large enough # so that results don't change meaningfully for different seeds. s <- dpa(Surv(start,stop,event)~M+x, list(M~x), id=\"subject\", data=simdata, boot.n=30) # Calculate cumulative direct, indirect, and total effects: direct <- effect(x ~ outcome, s) indirect <- effect(x ~ M ~ outcome, s) total <- sum(direct, indirect) # Plot the effects using basic graphics: 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 effects using ggplot2 graphics: ggplot.effect(list(direct, indirect, total))"},{"path":"http://opensource.nibr.com/dpasurv/reference/effect.html","id":null,"dir":"Reference","previous_headings":"","what":"Effect estimation in dynamic path analysis — effect","title":"Effect estimation in dynamic path analysis — effect","text":"effect estimation method class \"dpa\"","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/effect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Effect estimation in dynamic path analysis — effect","text":"","code":"effect(formula, object, alpha = 0.05)"},{"path":"http://opensource.nibr.com/dpasurv/reference/effect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Effect estimation in dynamic path analysis — effect","text":"formula formula direct indirect effect estimated. form: covariate ~ outcome direct effect covariate outcome, form: covariate ~ mediator ~ outcome indirect effect covariate outcome mediated mediator. Note word \"outcome\" reserved survival outcome process, word \"covariate\" \"mediator\" match corresponding variable name data input. Alternatively form can : covariate ~ mediator direct effects covariate mediator, : covariate ~ mediator1 ~ mediator2 indirect effects covariate mediator2 mediated mediator1. object object class \"dpa\" (obtained calling function dpa) effect estimated. alpha confidence level bootstrap intervals","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/effect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Effect estimation in dynamic path analysis — effect","text":"object class \"effect\" following fields: coefs data.frame containing unique event times along calculated effect coefficients. effects corresponding continuous variable results single effect column. factors n.levels categories data.frame contains n.levels-1 effect columns representing effect coefficient particular factor level (compared reference level). lower data.frame dimension coefs containing lower confidence bands effects stored coefs upper data.frame dimension coefs containing upper confidence bands effects stored coefs boot.coefs data.frame three columns: one column bootstrap sample ID, second column unique event times (per bootstrap sample), third column estimated effect coefficients (per bootstrap sample). storing effects per bootstrap sample facilitates calculation bootstrap confidence intervals sums indirect direct effects. label effect label path specification: \"direct\" direct effect \"indirect\" indirect effect mediated path mediator(s) scale scale effect coefficients coefs, lower, upper: \"cumulative\" (effects outcome) \"identity\" (effects mediators) alpha confidence level bootstrap intervals","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/effect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Effect estimation in dynamic path analysis — effect","text":"","code":"library(dpasurv) data(simdata) set.seed(1) # Perform dynamic path analysis: # We set boot.n=30 for the example to run fast, should be set large enough # so that results don't change meaningfully for different seeds. s <- dpa(Surv(start,stop,event)~M+x, list(M~x), id=\"subject\", data=simdata, boot.n=30) direct <- effect(x ~ outcome, s) indirect <- effect(x ~ M ~ outcome, s) total <- sum(direct, indirect)"},{"path":"http://opensource.nibr.com/dpasurv/reference/find.variables.html","id":null,"dir":"Reference","previous_headings":"","what":"Find variables of a given formula — find.variables","title":"Find variables of a given formula — find.variables","text":"call function ","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/find.variables.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find variables of a given formula — find.variables","text":"","code":"find.variables(formula)"},{"path":"http://opensource.nibr.com/dpasurv/reference/find.variables.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find variables of a given formula — find.variables","text":"formula","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/find.variables.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find variables of a given formula — find.variables","text":"character vector formula's variable names","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/find.variables.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find variables of a given formula — find.variables","text":"","code":"library(dpasurv) data(simdata) vars <- find.variables(x ~ outcome)"},{"path":"http://opensource.nibr.com/dpasurv/reference/get.meta.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal function that gathers meta data on the input to function dpa — get.meta","title":"Internal function that gathers meta data on the input to function dpa — get.meta","text":"call function ","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/get.meta.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal function that gathers meta data on the input to function dpa — get.meta","text":"","code":"get.meta(out.formula, mediator.formulas, data)"},{"path":"http://opensource.nibr.com/dpasurv/reference/get.meta.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal function that gathers meta data on the input to function dpa — get.meta","text":".formula Survival formula Aalen's additive hazards model. mediator.formulas list mediator regression formulas. data Data set counting process format. particular data contain \"start\", \"stop\" \"event\" column along mediators baseline covariates.","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/get.meta.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Internal function that gathers meta data on the input to function dpa — get.meta","text":"function returns meta data associated call dpasurv::dpa","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/get.meta.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Internal function that gathers meta data on the input to function dpa — get.meta","text":"","code":"library(dpasurv) data(simdata) meta <- get.meta(Surv(start, stop, event) ~ x + M, list(M ~ x), simdata)"},{"path":"http://opensource.nibr.com/dpasurv/reference/ggplot.effect.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot effects from dynamic path analysis along with bootstrap confidence bands — ggplot.effect","title":"Plot effects from dynamic path analysis along with bootstrap confidence bands — ggplot.effect","text":"plotting method class \"effect\"","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/ggplot.effect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot effects from dynamic path analysis along with bootstrap confidence bands — ggplot.effect","text":"","code":"ggplot.effect( object, relative = FALSE, titles = NULL, x_label = \"Time\", y_label = NULL )"},{"path":"http://opensource.nibr.com/dpasurv/reference/ggplot.effect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot effects from dynamic path analysis along with bootstrap confidence bands — ggplot.effect","text":"object object class \"effect\", list objects class \"effect\" relative effect plotted relative survival scale (.e. `y=exp(-effect)`)?. Defaults FALSE. titles NULL, function automatically generate. Otherwise character vector length equal number elements object list x_label Label x-axis. Defaults \"Time\" y_label Label y-axis. Default object scale \"cumulative\" \"Cumulative Effect\" (relative=FALSE) \"Relative survival\" (relative=TRUE). object scale \"identity\" default y_label \"Effect\".","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/ggplot.effect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot effects from dynamic path analysis along with bootstrap confidence bands — ggplot.effect","text":"ggplot object","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/ggplot.effect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot effects from dynamic path analysis along with bootstrap confidence bands — ggplot.effect","text":"","code":"library(dpasurv) data(simdata) set.seed(1) # Perform dynamic path analysis: # We set boot.n=30 for the example to run fast, should be set large enough # so that results don't change meaningfully for different seeds. s <- dpa(Surv(start,stop,event)~M+x, list(M~x), id=\"subject\", data=simdata, boot.n=30) direct <- effect(x ~ outcome, s) indirect <- effect(x ~ M ~ outcome, s) total <- sum(direct, indirect) ggplot.effect(direct) ggplot.effect(list(direct, indirect, total))"},{"path":"http://opensource.nibr.com/dpasurv/reference/plot.effect.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot effects from dynamic path analysis along with bootstrap confidence bands — plot.effect","title":"Plot effects from dynamic path analysis along with bootstrap confidence bands — plot.effect","text":"plotting method class \"effect\"","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/plot.effect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot effects from dynamic path analysis along with bootstrap confidence bands — plot.effect","text":"","code":"# S3 method for class 'effect' plot(x, relative = FALSE, ...)"},{"path":"http://opensource.nibr.com/dpasurv/reference/plot.effect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot effects from dynamic path analysis along with bootstrap confidence bands — plot.effect","text":"x object class \"effect\" relative effect plotted relative survival scale (.e. `y=exp(-effect)`)?. Defaults FALSE. ... graphical parameters passed graphics::plot function.","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/plot.effect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot effects from dynamic path analysis along with bootstrap confidence bands — plot.effect","text":"","code":"library(dpasurv) data(simdata) set.seed(1) # Perform dynamic path analysis: # We set boot.n=30 for the example to run fast, should be set large enough # so that results don't change meaningfully for different seeds. s <- dpa(Surv(start,stop,event)~M+x, list(M~x), id=\"subject\", data=simdata, boot.n=30) direct <- effect(x ~ outcome, s) indirect <- effect(x ~ M ~ outcome, s) total <- sum(direct, indirect) 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)"},{"path":"http://opensource.nibr.com/dpasurv/reference/simdata.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulated data — simdata","title":"Simulated data — simdata","text":"simulated data set (start,stop] format. subject column refers subject ID note multiple rows per subject. columns x dose correspond treatment dose variable respectively, M refers longitudinal mediator values. triplet (start, stop, event) corresponds time--event data required (start,stop] format.","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/simdata.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Simulated data — simdata","text":"data frame following variables: subject (fct), x (dbl), dose (fct), M (dbl), start (dbl), stop (dbl), event (dbl).","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/sum.effect.html","id":null,"dir":"Reference","previous_headings":"","what":"Sum of direct and indirect effects from dynamic path analysis — sum.effect","title":"Sum of direct and indirect effects from dynamic path analysis — sum.effect","text":"sum method class \"effect\"","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/sum.effect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sum of direct and indirect effects from dynamic path analysis — sum.effect","text":"","code":"# S3 method for class 'effect' sum(effect1, effect2, ...)"},{"path":"http://opensource.nibr.com/dpasurv/reference/sum.effect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sum of direct and indirect effects from dynamic path analysis — sum.effect","text":"effect1 object class \"effect\" obtained call function effect() effect2 second object class \"effect\" obtained call function effect() ... additional objects class \"effect\" (number effects allowed)","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/sum.effect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Sum of direct and indirect effects from dynamic path analysis — sum.effect","text":"object class \"effect\" containing sum effect1, effect2, ...","code":""},{"path":"http://opensource.nibr.com/dpasurv/reference/sum.effect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Sum of direct and indirect effects from dynamic path analysis — sum.effect","text":"","code":"library(dpasurv) data(simdata) set.seed(1) # Perform dynamic path analysis: # We set boot.n=30 for the example to run fast, should be set large enough # so that results don't change meaningfully for different seeds. s <- dpa(Surv(start,stop,event)~M+x, list(M~x), id=\"subject\", data=simdata, boot.n=30) direct <- effect(x ~ outcome, s) indirect <- effect(x ~ M ~ outcome, s) total <- sum(direct, indirect)"},{"path":"http://opensource.nibr.com/dpasurv/news/index.html","id":"dpasurv-010","dir":"Changelog","previous_headings":"","what":"dpasurv 0.1.0","title":"dpasurv 0.1.0","text":"First release.","code":""}] diff --git a/sitemap.xml b/sitemap.xml index b1217ba..36421d5 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1,6 +1,7 @@ http://opensource.nibr.com/dpasurv/404.html http://opensource.nibr.com/dpasurv/LICENSE-text.html +http://opensource.nibr.com/dpasurv/LICENSE.html http://opensource.nibr.com/dpasurv/articles/dpa.html http://opensource.nibr.com/dpasurv/articles/ggplot_demo.html http://opensource.nibr.com/dpasurv/articles/index.html