Description Usage Arguments Value Examples
View source: R/mediation_single.R
A causal mediation method with a single CpG site as the mediator
1 | mediation_single(pheno, predictor, cpg, covariate, family = "gaussian")
|
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. |
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
1 2 3 4 5 6 7 8 9 10 11 12 13 | ################
### 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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.