mediation_single {MRmediation} | R Documentation |
A causal mediation method with a single CpG site as the mediator
Description
A causal mediation method with a single CpG site as the mediator
Usage
mediation_single(pheno, predictor, cpg, covariate, family = "gaussian")
Arguments
pheno |
A vector of continuous or binary phenotypes (class: numeric). |
predictor |
A vector of values for the exposure variable (class: numeric). |
cpg |
A vector of a CpG (class: numeric). |
covariate |
A matrix of covariates. Each column is a covariate (class: data.frame). |
family |
"gaussian" for continuous outcome or "binomial" for binary outcome. |
Value
1. pval$TE: total effect (TE) p-value
2. pval$DE: direct effect (DE) p-value
3. pval$IE: indirect effect (IE) p-value
4. pval_MX: p-value for the association between methylation and exposure
Examples
################
### Examples ###
################
data("example_data")
predictor = data$exposure
cpg = data[,9] #any number in c(7:dim(data)[2])
covariates = subset(data, select=c("age","gender"))
# binary outcome
pheno_bin = data$pheno_bin
mediation_single(pheno_bin, predictor, cpg, covariate=covariates, family="binomial")
# continuous outcome
pheno_con = data$pheno_con
mediation_single(pheno_con, predictor, cpg, covariate=covariates, family="gaussian")
[Package MRmediation version 1.0.1 Index]