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)
# \donttest{
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)
# }
Run the code above in your browser using DataLab