Description Usage Arguments Details Value Author(s) Examples
Estimate various quantities for causal mediation analysis for each DMRs, including average causal mediation effects (indirect effect), average direct effects, proportions mediated, and total effect.
1 | univariate_mediation_DMR(X, Y, DMR, covar = NULL, U = NULL, sims = 3)
|
X |
an explanatory variable matrix with n rows and d columns. Each column corresponds to a distinct explanatory variable (Exposure). Explanatory variables must be encoded as numeric variables. |
Y |
an explanatory variable matrix with n rows and d columns. Each column corresponds to a distinct explanatory variable (Outcome). Explanatory variables must be encoded as numeric variables. |
DMR |
a matrix of DMRs from the DMR_built() function (DMR_acp). |
covar |
set of covariable, must be numeric. |
U |
set of latent factors from multivariate_EWAS() function |
sims |
number of Monte Carlo draws for nonparametric bootstrap or quasi-Bayesian approximation. 10000 is recommended. |
... |
argument of the mediate function from the mediation package |
We use the mediate() function of the mediation package on the set of selected DMRs. This function makes it possible to estimate their indirect effects and to test their significance.
Tables of results of mediation analyzes for markers with a qValue below the FDR threshold. Indirect effect (ACME - average causal mediation effect), ADE (average direct effect), PM (proportion mediated) and TE (total effect). Composition of tables: estimated effect, confidence interval and mediation pValue.
Basile Jumentier
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | library(highmed)
# Run multivariate EWAS
res <- multivariate_EWAS(X = example$X, Y = example$Y, M = example$M, K = 5)
# Keep latent factors for univariate mediation
U <- res$U
# Run max2
res <- max2(pval1 = res$pValue[, 1], pval2 = res$pValue[, 2])
# lauch DMR_search
res <- DMR_search(chr = example$annotation$chr,
start = example$annotation$start,
end = example$annotation$end,
pval = res$pval,
cpg = example$annotation$cpg, nCores = 1)
# lauch DMR_built
tmp <- DMR_built(res, methylation = example$M, nb_cpg = 2)
# Univariate mediation for each DMR
res <- univariate_mediation_DMR(X = example$X, Y = example$Y, DMR = tmp$DMR_acp, U = U, sims = 3)
# Summary plot
plot_summary_DMR(res, tmp)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.