hdbm {hdbm} | R Documentation |
High Dimensional Bayesian Mediation
Description
hdbm
is a Bayesian inference method that uses continuous shrinkage priors
for high-dimensional mediation analysis, developed by Song et al (2018).
hdbm
provides estimates for the regression coefficients as well as
the posterior inclusion probability for ranking mediators.
Usage
hdbm(Y, A, M, C1, C2, beta.m, alpha.a, burnin, ndraws)
Arguments
Y |
numeric outcome vector. |
A |
numeric exposure vector. |
M |
numeric matrix of mediators of Y and A. |
C1 |
numeric matrix of extra covariates in the outcome model |
C2 |
numeric matrix of extra covariates in the mediator model |
beta.m |
numeric vector of initial beta.m in the outcome model |
alpha.a |
numeric vector of initial alpha.a in the mediator model |
burnin |
number of iterations to run the MCMC before sampling |
ndraws |
number of draws to take from MCMC after the burnin period |
Details
hdbm
uses two regression models for the two conditional relationships,
Y | A, M, C1
and M | A, C2
. For the outcome model, hdbm
uses
Y = M \beta_M + A * \beta_A + C1* \beta_CY + \epsilon_Y
For the mediator model, hdbm
uses the model
M = A * \alpha_A + C2 * \alpha_C2 + \epsilon_M
For high dimensional tractability, hdbm
employs continuous Bayesian
shrinkage priors to select mediators and makes the two following assumptions:
First, it assumes that all the potential mediators contribute small effects
in mediating the exposure-outcome relationship. Second, it assumes
that only a small proportion of mediators exhibit large effects
("active" mediators). hdbm
uses a Metropolis-Hastings within Gibbs
MCMC to generate posterior samples from the model.
Value
hdbm returns a list with 11 elements (each of length ndraws
),
sampled from the burned in MCMC:
- beta.m
Outcome model mediator coefficients
- r1
Whether or not each beta.m belongs to the larger normal component (1) or smaller normal component (0)
- alpha.a
Mediator model exposure coefficients
- r3
Whether or not each alpha.a belongs to the larger normal component (1) or smaller normal component (0)
- beta.a
beta.a coefficient
- pi.m
Proportion of non zero beta.m coefficients
- pi.a
Proportion of non zero alpha.a coefficients
- sigma.m0
standard deviation of the smaller normal component for mediator-outcome coefficients (beta.m)
- sigma.m1
standard deviation of the larger normal component for mediator-outcome coefficients (beta.m)
- sigma.ma0
Standard deviation of the smaller normal component for exposure-mediator coefficients (alpha.a)
- sigma.ma1
Standard deviation of the larger normal component for exposure-mediator coefficients (alpha.a)
Author(s)
Alexander Rix
References
Yanyi Song, Xiang Zhou et al. Bayesian Shrinkage Estimation of High Dimensional Causal Mediation Effects in Omics Studies. bioRxiv 10.1101/467399
Examples
library(hdbm)
Y <- hdbm.data$y
A <- hdbm.data$a
# grab the mediators from the example data.frame
M <- as.matrix(hdbm.data[, paste0("m", 1:100)], nrow(hdbm.data))
# We just include the intercept term in this example.
C <- matrix(1, 1000, 1)
beta.m <- rep(0, 100)
alpha.a <- rep(0, 100)
set.seed(12345)
hdbm.out <- hdbm(Y, A, M, C, C, beta.m, alpha.a,
burnin = 1000, ndraws = 100)
# Which mediators are active?
active <- which(colSums(hdbm.out$r1 * hdbm.out$r3) > 50)
colnames(M)[active]