mediate_bslmm {hdmed}R Documentation

Bayesian Sparse Linear Mixed Model

Description

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.

Usage

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
)

Arguments

A

length n numeric vector containing exposure variable

M

n x p numeric matrix of high-dimensional mediators.

Y

length n numeric vector containing continuous outcome variable.

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 C1.

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 1e-4. If k=2, this parameter equals the prior mean on the smaller normal variance.

lm1

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.

lma1

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.

l

scale parameter for the other inverse gamma priors.

Details

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.

Value

A list containing:

References

Song, Y. et al. Bayesian shrinkage estimation of high dimensional causal mediation effects in omics studies. Biometrics 76, 700-710 (2020).

Examples

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)



[Package hdmed version 1.0.1 Index]