AA_Mediation: Causal Mediation Analysis (CMA)

Description Usage Arguments Details Value Author(s) Examples

View source: R/AA_CausalMediation.R

Description

CMA examines the intermediate process(Mediation variable:M) by which the independent variable(X) affects the dependent variable(Y). Firstly, building Mediator Model(model.m): f(M | X + AdjVar); and then Outcome Model: f(Y = X + M + AdjVar). Secondly, mediation_out <- mediateY, M, X, AdjVar, model.y, model.m to perform mediation analysis. Finally, extracting the results of mediation_out.

Usage

1
AA_Mediation(dataset=Metadata, XVar="Lysine", YVar="Tryptophan", AdjVar=c("Age", "Gender"), Package="mediation")

Arguments

dataset,

Matrix; (Required) Metadata.

XVar,

Character; independent variable.

YVar,

Character; dependent variable.

MVar,

Character; mediator.

AdjVar,

Character; adjust variable(default: AdjVar=NULL).

Package,

Character; (Required) package for CMA (default: Package="mediation").

Details

12/5/2021 Guangzhou China

Value

a list of results CMA model Sensitivity analysis of CMA model Table of CMA model

Author(s)

Hua Zou

Examples

1
2
3
4
5
6
7
8
9
data(ExprSetRawRB)
library(Biobase)
Metadata <- pData(ExprSetRawRB)

# mediation package & one mediation
Mediation_res1 <- AA_Mediation(dataset=Metadata, XVar="Lysine", YVar="Tryptophan", AdjVar=c("Age", "Gender"), MVar="BMI", Package="mediation")

# intmed package or two mediation
Mediation_res2 <- AA_Mediation(dataset=Metadata, XVar="Lysine", YVar="Tryptophan", AdjVar=c("Age", "Gender"), MVar=c("BMI", "Age"), Package="intmed")

HuaZou/MyRtools documentation built on Jan. 6, 2022, 8:56 a.m.