Description Usage Arguments Details Value Author(s) Examples
Estimate various quantities for causal mediation analysis for each significant markers, including average causal mediation effects (indirect effect), average direct effects, proportions mediated, and total effect.
1 2 3 4 5 6 7 8 9 10 11 | univariate_mediation(
qval,
X,
Y,
M,
covar = NULL,
U = NULL,
FDR = 0.1,
sims = 3,
...
)
|
qval |
set of qValues from max2() function |
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. |
M |
a response variable matrix with n rows and p columns. Each column corresponds to a beta-normalized methylation profile. Response variables must be encoded as numeric. No NAs allowed. |
covar |
set of covariable, must be numeric. |
U |
set of latent factors from multivariate_EWAS() function |
FDR |
FDR threshold to pass markers in mediation analysis |
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 markers having a qValue lower than the FDR threshold. 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 | library(highmed)
data(example)
# 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])
# Run Univariate mediation (only 3 simulations for estimate and test indirect effect)
res <- univariate_mediation(qval = res$qval,
X = example$X,
Y = example$Y,
M = example$M,
U = U, sims = 3)
# Plot summary
plot_summary_ACME(res$ACME)
plot_summary_med(res)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.