fdr.bama {bama} | R Documentation |
Bayesian Mediation Analysis Controlling For False Discovery
Description
fdr.bama
uses the permutation test to estimate the null PIP
distribution for each mediator and determines a threshold (based off of the
fdr
parameter) for significance.
Usage
fdr.bama(
Y,
A,
M,
C1,
C2,
beta.m,
alpha.a,
burnin,
ndraws,
weights = NULL,
npermutations = 200,
fdr = 0.1,
k = 2,
lm0 = 1e-04,
lm1 = 1,
lma1 = 1,
l = 1,
mc.cores = 1,
type = "PSOCK"
)
Arguments
Y |
Length |
A |
Length |
M |
|
C1 |
|
C2 |
|
beta.m |
Length |
alpha.a |
Length |
burnin |
Number of iterations to run the MCMC before sampling |
ndraws |
Number of draws to take from MCMC after the burnin period |
weights |
Length |
npermutations |
The number of permutations to generate while estimating the null pip distribution. Default is 200 |
fdr |
False discovery rate. Default is 0.1 |
k |
Shape parameter prior for inverse gamma. Default is 2.0 |
lm0 |
Scale parameter prior for inverse gamma for the small normal components. Default is 1e-4 |
lm1 |
Scale parameter prior for inverse gamma for the large normal component of beta_m. Default is 1.0 |
lma1 |
Scale parameter prior for inverse gamma for the large normal component of alpha_a. Default is 1.0 |
l |
Scale parameter prior for the other inverse gamma distributions. Default is 1.0 |
mc.cores |
The number of cores to use while running |
type |
Type of cluster to make when |
Value
fdr.bama
returns a object of type "fdr.bama" with 5 elements:
- bama.out
Output from the
bama
run.- pip.null
A
p x npermutations
matrices containing the estimated null PIP distribution for each mediator.- threshold
The cutoff significance threshold for each PIP controlling for the false discovery rate.
- fdr
The false discovery rate used to calculate
threshold
.- call
The R call that generated the output.
Author(s)
Alexander Rix
References
Song, Y, Zhou, X, Zhang, M, et al. Bayesian shrinkage estimation of high dimensional causal mediation effects in omics studies. Biometrics. 2019; 1-11. doi:10.1111/biom.13189
Examples
library(bama)
Y <- bama.data$y
A <- bama.data$a
# grab the mediators from the example data.frame
M <- as.matrix(bama.data[, paste0("m", 1:100)], nrow(bama.data))
# We just include the intercept term in this example as we have no covariates
C1 <- matrix(1, 1000, 1)
C2 <- matrix(1, 1000, 1)
beta.m <- rep(0, 100)
alpha.a <- rep(0, 100)
set.seed(12345)
out <- fdr.bama(Y, A, M, C1, C2, beta.m, alpha.a, burnin = 100,
ndraws = 120, npermutations = 10)
# The package includes a function to summarise output from 'fdr.bama'
summary(out)