## knitr configuration: http://yihui.name/knitr/options#chunk_options library(knitr) showMessage <- FALSE showWarning <- TRUE set_alias(w = "fig.width", h = "fig.height", res = "results") opts_chunk$set(comment = "##", error= TRUE, warning = showWarning, message = showMessage, tidy = FALSE, cache = FALSE, echo = TRUE, fig.width = 7, fig.height = 7, fig.path = "man/figures") ## for rgl ## knit_hooks$set(rgl = hook_rgl, webgl = hook_webgl) ## for animation opts_knit$set(animation.fun = hook_ffmpeg_html) ## R configuration options(width = 116, scipen = 5)
This is an extension of the regression-based causal mediation analysis first proposed by Valeri and VanderWeele (2013) and Valeri and VanderWeele (2015). The current version supports including effect measure modification by covariates (treatment-covariate and mediator-covariate product terms in mediator and outcome regression models). It also accommodates the original 'SAS' macro (can be found at Dr. VanderWeele's Tools and Tutorials) and PROC CAUSALMED procedure in 'SAS' when there is no effect measure modification. Linear and logistic models are supported for the mediator model. Linear, logistic, loglinear, Poisson, negative binomial, Cox, and accelerated failure time (exponential and Weibull) models are supported for the outcome model.
To cite this software, please cite Li et al (2023)
The following grid of models are implemented. yreg
refers to the outcome model and mreg
refers to the mediator model.