mediate_hdmm
estimates the first "direction of mediation" in the
causal mediation mechanism of an exposure A
, an outcome Y
, and high-dimensional
mediators M
as proposed by Chén et al. (2018).
mediate_hdmm(
A,
M,
Y,
sims = 1000,
boot_ci_type = "bca",
ci_level = 0.95,
tol = 10^-5,
theta = rep(1, 5),
w1 = rep(1, ncol(M)),
interval = 10^6,
step = 10^4,
imax = 100
)
A list containing:
pdm: the first direction of mediation by which mediators are weighted.
mediator: the latent mediator corresponding to the first direction of mediation.
effects: a data frame containing the estimates, confidence intervals, and p-values of the mediation effects.
numeric vector containing exposure variable.
numeric matrix of high-dimensional mediators. It is not recommended to supply a matrix with more mediators than observations.
numeric vector containing continuous outcome variable.
number of Monte Carlo draws for nonparametric bootstrap or
quasi-Bayesian approximation. See mediate
. Default is 1000.
a character string indicating the type of bootstrap
confidence intervals for when boot = TRUE
. If "bca"
,
bias-corrected and accelerated (BCa) confidence intervals will be estimated.
If "perc"
, percentile confidence intervals will be estimated
(see mediation::mediate()
). Default is "bca".
the designated confidence level. Default 0.95.
tolerance. Default 10^-5.
numeric vector of length 5 describing starting value of pathway coefficients. Default is a vector of 1's.
numeric vector of the same length of A
specifying PDM
starting values. Default is a vector of 1's.
numeric vector proportional to the intervals from where the smoothing parameter is searched. Default is 10^6.
numerical number specifying step width for smoothing parameter search. Default is 10^4.
integer specifying the maximum number of iterations allowed. Default is 100.
HDMM provides latent variable approach to high-dimensional mediation analysis.
The function mediate_hdmm
uses a likelihood-based approach to compute
principal directions of mediation (PDMs), which are loading weights used to linearly
combine the inputted mediators to form a single, latent variable that replaces
the original mediators in the analysis. Though HDMM cannot be used to estimate
the global mediation effect or the contributions of specific mediators, it can
still can be useful for inferring whether there is mediation occurring through
the set of mediators as a joint system. See the provided reference for more
details.
Chén, O. Y. et al. High-dimensional multivariate mediation with application to neuroimaging data. Biostatistics 19, 121-136 (2018).
A <- as.numeric(scale(med_dat$A)) # can help to standardize
M <- scale(med_dat$M[,1:8])
Y <- as.numeric(scale(med_dat$Y))
out <- mediate_hdmm(A, M, Y, sims = 5, tol = 10^-3, imax = 50)
out$effects
Run the code above in your browser using DataLab