Title: | Compositional Mediation Model |
---|---|
Description: | Estimate the direct and indirect (mediation) effects of treatment on the outcome when intermediate variables (mediators) are compositional and high-dimensional. Sohn, M.B. and Li, H. (2017). Compositional Mediation Analysis for Microbiome Studies. (AOAS: In revision). |
Authors: | Michael B. Sohn |
Maintainer: | Michael B. Sohn <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0 |
Built: | 2024-12-18 06:34:16 UTC |
Source: | CRAN |
Estimate the direct and indirect (mediation) effects of treatment on the outcome when intermediate variables (mediators) are compositional and high-dimensional.
Michael B. Sohn
Maintainer: Michael B. Sohn <[email protected]>
Sohn, M.B. and Li, H. (2017). Compositional Mediation Analysis for Microbiome Studies. (AOAS: In revision)
## Not run: # Load test data data(ccmm_test_data); head(ccmm_test_data); outcome <- ccmm_test_data[,1]; treatment <- ccmm_test_data[,2]; mediators <- as.matrix(ccmm_test_data[,3:22]); covariates <- as.matrix(ccmm_test_data[,23:24]); # Run CCMM rslt.ccmm <- ccmm(outcome, mediators, treatment, covariates); # Sensitivity analysis rslt.sa <- ccmm.sa(outcome, mediators, treatment, covariates); plot(rslt.sa, type="l", xlab=expression(rho), ylab="TIDE") abline(h=rslt.ccmm$TIDE, lty=2) abline(h=0, lty=3) cisa <- tide.ci.zero.rho(outcome, mediators, treatment, covariates) csqs <- quantile(cisa, c(0.025, 0.975)) segments(0, csqs[1], 0, csqs[2]) ## End(Not run)
## Not run: # Load test data data(ccmm_test_data); head(ccmm_test_data); outcome <- ccmm_test_data[,1]; treatment <- ccmm_test_data[,2]; mediators <- as.matrix(ccmm_test_data[,3:22]); covariates <- as.matrix(ccmm_test_data[,23:24]); # Run CCMM rslt.ccmm <- ccmm(outcome, mediators, treatment, covariates); # Sensitivity analysis rslt.sa <- ccmm.sa(outcome, mediators, treatment, covariates); plot(rslt.sa, type="l", xlab=expression(rho), ylab="TIDE") abline(h=rslt.ccmm$TIDE, lty=2) abline(h=0, lty=3) cisa <- tide.ci.zero.rho(outcome, mediators, treatment, covariates) csqs <- quantile(cisa, c(0.025, 0.975)) segments(0, csqs[1], 0, csqs[2]) ## End(Not run)
Estimate the direct and indirect (mediation) effects of treatment on the outcome when intermediate variables (mediators) are compositional and high-dimensional.
ccmm(y, M, tr, x = NULL, w = NULL, method.est.cov = "bootstrap", n.boot = 2000, sig.level = 0.05, tol = 1e-06, max.iter = 5000)
ccmm(y, M, tr, x = NULL, w = NULL, method.est.cov = "bootstrap", n.boot = 2000, sig.level = 0.05, tol = 1e-06, max.iter = 5000)
y |
Vector of continuous outcomes |
M |
Matrix of compositional data |
tr |
Vector of continuous or binary treatments |
x |
Matrix of covariates |
w |
Vector of weights on samples |
method.est.cov |
One of two options ("bootstrap", "normal") to estimate the variance of indirect effects |
n.boot |
Number of bootstrap samples |
sig.level |
Significance level to estimate bootstrap confidence intervals for direct and indirect effects of treatment |
tol |
Error tolerance |
max.iter |
Maximum number of iteration in a debias procedure |
If method.est.cov is "bootstrap",
DE |
Direct effect of treatment on an outcome |
DE.CI |
Bootstrap confidence interval for the direct effect |
TIDE |
Total indirect effect of treatment on an outcome |
TIDE.CI |
Bootstrap confidence interval for the indirect effect |
IDEs |
Component-wise indirect effects of treatment on an outcome |
IDE.CIs |
Bootstrap confidence intervals for the component-wise indirect effects |
If method.est.cov is "normal",
DE |
Direct effect of treatment on an outcome |
Var.DE |
Variance of the direct effect |
TIDE |
Total indirect effect of treatment on an outcome |
Var.TIDE |
Variance of the indirect effect |
IDEs |
Component-wise indirect effects of treatment on an outcome |
Var.IDEs |
Variances of the component-wise indirect effects |
Michael B. Sohn
Maintainer: Michael B. Sohn <[email protected]>
Sohn, M.B. and Li, H. (2017). Compositional Mediation Analysis for Microbiome Studies (AOAS: In revision)
# Load test data data(ccmm_test_data); outcome <- ccmm_test_data[,1]; treatment <- ccmm_test_data[,2]; mediators <- as.matrix(ccmm_test_data[,3:22]); covariates <- as.matrix(ccmm_test_data[,23:24]); # Run CCMM rslt.ccmm <- ccmm(outcome, mediators, treatment, covariates);
# Load test data data(ccmm_test_data); outcome <- ccmm_test_data[,1]; treatment <- ccmm_test_data[,2]; mediators <- as.matrix(ccmm_test_data[,3:22]); covariates <- as.matrix(ccmm_test_data[,23:24]); # Run CCMM rslt.ccmm <- ccmm(outcome, mediators, treatment, covariates);
Contains artificial 200 samples with a continuous outcome variable y, a continuous treatment tr, 20 compositional mediators M and 2 covariates X. The true direct and indirect effects of treatment on the outcome both are 1.00. The true component-wise indirect effects (M1-M20) are 0.693, -0.425, 0.135, -0.057, -0.268, 0.970, -0.843, 0.805, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000.
data(ccmm_test_data)
data(ccmm_test_data)
Estimated total indirect effects (TIDE) given correlation coefficients (rho)
ccmm.sa(y, M, tr, x = NULL, w = NULL, stp = 0.01)
ccmm.sa(y, M, tr, x = NULL, w = NULL, stp = 0.01)
y |
Vector of continuous outcomes |
M |
Matrix of compositional data |
tr |
Vector of continuous or binary treatments |
x |
Matrix of covariates |
w |
Vector of weights on samples |
stp |
Increment of the correlation coefficient |
Matrix of rho and TIDE
Michael B. Sohn
Maintainer: Michael B. Sohn <[email protected]>
Sohn, M.B. and Li, H. (2017). Compositional Mediation Analysis for Microbiome Studies (AOAS: In revision)
# Load test data data(ccmm_test_data); outcome <- ccmm_test_data[,1]; treatment <- ccmm_test_data[,2]; mediators <- as.matrix(ccmm_test_data[,3:22]); covariates <- as.matrix(ccmm_test_data[,23:24]); rslt.sa <- ccmm.sa(outcome, mediators, treatment, covariates);
# Load test data data(ccmm_test_data); outcome <- ccmm_test_data[,1]; treatment <- ccmm_test_data[,2]; mediators <- as.matrix(ccmm_test_data[,3:22]); covariates <- as.matrix(ccmm_test_data[,23:24]); rslt.sa <- ccmm.sa(outcome, mediators, treatment, covariates);
Estimate the total indirect effect (TIDE) given a correlation coefficient
ccmm.sensitivity(rh, y, M, tr, x = NULL, w = NULL)
ccmm.sensitivity(rh, y, M, tr, x = NULL, w = NULL)
rh |
Correlation coefficient |
y |
Vector of continuous outcomes |
M |
Matrix of compositional data |
tr |
Vector of continuous or binary treatments |
x |
Matrix of covariates |
w |
Vector of weights on samples |
Estimated TIDE given a correlation coefficient
Michael B. Sohn
Maintainer: Michael B. Sohn <[email protected]>
Sohn, M.B. and Li, H. (2017). Compositional Mediation Analysis for Microbiome Studies (AOAS: In revision)
# Load test data data(ccmm_test_data); outcome <- ccmm_test_data[,1]; treatment <- ccmm_test_data[,2]; mediators <- as.matrix(ccmm_test_data[,3:22]); covariates <- as.matrix(ccmm_test_data[,23:24]); ccmm.sensitivity(rh=0, outcome, mediators, treatment, covariates);
# Load test data data(ccmm_test_data); outcome <- ccmm_test_data[,1]; treatment <- ccmm_test_data[,2]; mediators <- as.matrix(ccmm_test_data[,3:22]); covariates <- as.matrix(ccmm_test_data[,23:24]); ccmm.sensitivity(rh=0, outcome, mediators, treatment, covariates);
Generate bootstrap samples of the total indirect effect (TIDE) when the correlation coefficient is zero
tide.ci.zero.rho(y, M, tr, x = NULL, w = NULL, n.boot=2000)
tide.ci.zero.rho(y, M, tr, x = NULL, w = NULL, n.boot=2000)
y |
Vector of continuous outcomes |
M |
Matrix of compositional data |
tr |
Vector of continuous or binary treatments |
x |
Matrix of covariates |
w |
Vector of weights on samples |
n.boot |
Number of bootstrap samples |
bootstrap samples of TIDE
Michael B. Sohn
Maintainer: Michael B. Sohn <[email protected]>
Sohn, M.B. and Li, H. (2017). Compositional Mediation Analysis for Microbiome Studies (AOAS: In revision)
# Load test data data(ccmm_test_data); outcome <- ccmm_test_data[,1]; treatment <- ccmm_test_data[,2]; mediators <- as.matrix(ccmm_test_data[,3:22]); covariates <- as.matrix(ccmm_test_data[,23:24]); cisa <- tide.ci.zero.rho(outcome, mediators, treatment, covariates, n.boot=200)
# Load test data data(ccmm_test_data); outcome <- ccmm_test_data[,1]; treatment <- ccmm_test_data[,2]; mediators <- as.matrix(ccmm_test_data[,3:22]); covariates <- as.matrix(ccmm_test_data[,23:24]); cisa <- tide.ci.zero.rho(outcome, mediators, treatment, covariates, n.boot=200)