mediate_bslmm
fits the Bayesian sparse linear mixed model proposed by
Song et al. (2020) for high-dimensional mediation analysis, estimating the
mediation contributions of potential mediators.
mediate_bslmm(
A,
M,
Y,
C1 = NULL,
C2 = C1,
burnin = 30000,
ndraws = 5000,
ci_level = 0.95,
weights = NULL,
k = 2,
lm0 = 1e-04,
lm1 = 1,
lma1 = 1,
l = 1
)
A list containing:
contributions: a data frame containing the estimates, Bayesian credible intervals, and posterior inclusion probabilities of the mediation contributions.
effects: a data frame containing the estimated direct, global mediation, and total effects
length n
numeric vector containing exposure variable
n x p
numeric matrix of high-dimensional mediators.
length n
numeric vector containing continuous outcome variable.
optional numeric matrix of covariates to include in the outcome model.
optional numeric matrix of covariates to include in the mediator
model. Default is C1
.
number of MCMC draws prior to sampling.
number of MCMC draws after burn-in.
the desired credible interval level. Default is 0.95.
optional numeric vector of observation weights.
shape parameter for the inverse gamma priors. Default is 2.
scale parameter for the inverse gamma prior on the variance of the
smaller-variance normal components. Default is 1e-4
. If k=2
,
this parameter equals the prior mean on the smaller normal variance.
scale parameter for the inverse gamma prior on the variance of the
larger-variance components of beta_m
. Default is 1. If k=2
,
this parameter equals the prior mean on the larger normal variance of the
mediator-outcome associations.
scale parameter for the inverse gamma prior on the variance of the
larger-variance components of alpha_a
. Default is 1. If k=2
,
this parameter equals the prior mean on the larger normal variance of the
exposure-mediator associations.
scale parameter for the other inverse gamma priors.
mediate_bslmm
is a wrapper function for the "BSLMM" option from bama::bama()
,
which fits a Bayesian sparse linear mixed model for performing mediation
analysis with high-dimensional mediators. The model assumes that
the mediator-outcome associations (\(\beta_m\)) and the exposure-mediator
associations (\(\alpha_a\)) independently follow a mixture of small-variance
and high-variance normal distributions, and that if a mediator \(M_j\) has both
\((\beta_m)_j\) and \((\alpha_a)_j\) belonging to the larger-variance distribution,
it has a notably large mediation contribution compared to the others. The
posterior inclusion probability (PIP) of belonging to both larger-variance
distributions is reported for each mediator as ab_pip
.
Song, Y. et al. Bayesian shrinkage estimation of high dimensional causal mediation effects in omics studies. Biometrics 76, 700-710 (2020).
A <- med_dat$A
M <- med_dat$M
Y <- med_dat$Y
# Toy example with small burnin and ndraws
out <- mediate_bslmm(A, M, Y, burnin = 100, ndraws = 10)
out$effects
head(out$contributions)
Run the code above in your browser using DataLab