mediate_bslmm | R Documentation |
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 |
length |
M |
|
Y |
length |
C1 |
optional numeric matrix of covariates to include in the outcome model. |
C2 |
optional numeric matrix of covariates to include in the mediator
model. Default is |
burnin |
number of MCMC draws prior to sampling. |
ndraws |
number of MCMC draws after burn-in. |
ci_level |
the desired credible interval level. Default is 0.95. |
weights |
optional numeric vector of observation weights. |
k |
shape parameter for the inverse gamma priors. Default is 2. |
lm0 |
scale parameter for the inverse gamma prior on the variance of the
smaller-variance normal components. Default is |
lm1 |
scale parameter for the inverse gamma prior on the variance of the
larger-variance components of |
lma1 |
scale parameter for the inverse gamma prior on the variance of the
larger-variance components of |
l |
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
.
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.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.