Title: | High Dimensional Bayesian Mediation Analysis |
---|---|
Description: | Perform mediation analysis in the presence of high-dimensional mediators based on the potential outcome framework. High dimensional Bayesian mediation (HDBM), developed by Song et al (2018) <doi:10.1101/467399>, relies on two Bayesian sparse linear mixed models to simultaneously analyze a relatively large number of mediators for a continuous exposure and outcome assuming a small number of mediators are truly active. This sparsity assumption also allows the extension of univariate mediator analysis by casting the identification of active mediators as a variable selection problem and applying Bayesian methods with continuous shrinkage priors on the effects. |
Authors: | Alexander Rix [aut, cre], Yanyi Song [aut] |
Maintainer: | Alexander Rix <[email protected]> |
License: | GPL-3 |
Version: | 0.9.0 |
Built: | 2024-12-16 06:52:36 UTC |
Source: | CRAN |
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.
hdbm(Y, A, M, C1, C2, beta.m, alpha.a, burnin, ndraws)
hdbm(Y, A, M, C1, C2, beta.m, alpha.a, burnin, ndraws)
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 |
hdbm
uses two regression models for the two conditional relationships,
and
. For the outcome model,
hdbm
uses
For the mediator model, hdbm
uses the model
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.
hdbm returns a list with 11 elements (each of length ndraws
),
sampled from the burned in MCMC:
Outcome model mediator coefficients
Whether or not each beta.m belongs to the larger normal component (1) or smaller normal component (0)
Mediator model exposure coefficients
Whether or not each alpha.a belongs to the larger normal component (1) or smaller normal component (0)
beta.a coefficient
Proportion of non zero beta.m coefficients
Proportion of non zero alpha.a coefficients
standard deviation of the smaller normal component for mediator-outcome coefficients (beta.m)
standard deviation of the larger normal component for mediator-outcome coefficients (beta.m)
Standard deviation of the smaller normal component for exposure-mediator coefficients (alpha.a)
Standard deviation of the larger normal component for exposure-mediator coefficients (alpha.a)
Alexander Rix
Yanyi Song, Xiang Zhou et al. Bayesian Shrinkage Estimation of High Dimensional Causal Mediation Effects in Omics Studies. bioRxiv 10.1101/467399
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]
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]
Synthetic example data for hdbm
hdbm.data
hdbm.data
A data.frame with 1000 observations on 102 variables:
Numeric response variable.
Numeric exposure variable.
Numeric mediator variables