| Type: | Package | 
| Title: | Compositional Mediation Model | 
| Version: | 1.0 | 
| Date: | 2017-08-27 | 
| Author: | Michael B. Sohn | 
| Maintainer: | Michael B. Sohn <msohn@mail.med.upenn.edu> | 
| 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). | 
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] | 
| Imports: | MASS | 
| NeedsCompilation: | no | 
| Packaged: | 2017-08-28 15:48:39 UTC; msohn | 
| Repository: | CRAN | 
| Date/Publication: | 2017-08-28 18:17:55 UTC | 
Causal 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.
Author(s)
Michael B. Sohn
Maintainer: Michael B. Sohn <msohn@mail.med.upenn.edu>
References
Sohn, M.B. and Li, H. (2017). Compositional Mediation Analysis for Microbiome Studies. (AOAS: In revision)
Examples
## 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)
Causal 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.
Usage
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)
Arguments
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  | 
Value
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  | 
Author(s)
Michael B. Sohn
Maintainer: Michael B. Sohn <msohn@mail.med.upenn.edu>
References
Sohn, M.B. and Li, H. (2017). Compositional Mediation Analysis for Microbiome Studies (AOAS: In revision)
Examples
# 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);
Sensitivity analysis
Description
Estimated total indirect effects (TIDE) given correlation coefficients (rho)
Usage
ccmm.sa(y, M, tr, x = NULL, w = NULL, stp = 0.01)
Arguments
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  | 
Value
Matrix of rho and TIDE
Author(s)
Michael B. Sohn
Maintainer: Michael B. Sohn <msohn@mail.med.upenn.edu>
References
Sohn, M.B. and Li, H. (2017). Compositional Mediation Analysis for Microbiome Studies (AOAS: In revision)
Examples
# 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);
Sensitivity analysis
Description
Estimate the total indirect effect (TIDE) given a correlation coefficient
Usage
ccmm.sensitivity(rh, y, M, tr, x = NULL, w = NULL)
Arguments
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  | 
Value
Estimated TIDE given a correlation coefficient
Author(s)
Michael B. Sohn
Maintainer: Michael B. Sohn <msohn@mail.med.upenn.edu>
References
Sohn, M.B. and Li, H. (2017). Compositional Mediation Analysis for Microbiome Studies (AOAS: In revision)
Examples
# 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);
Test Data
Description
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.
Usage
data(ccmm_test_data)
Bootstrap samples of TIDE with zero correlation
Description
Generate bootstrap samples of the total indirect effect (TIDE) when the correlation coefficient is zero
Usage
tide.ci.zero.rho(y, M, tr, x = NULL, w = NULL, n.boot=2000)
Arguments
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  | 
Value
bootstrap samples of TIDE
Author(s)
Michael B. Sohn
Maintainer: Michael B. Sohn <msohn@mail.med.upenn.edu>
References
Sohn, M.B. and Li, H. (2017). Compositional Mediation Analysis for Microbiome Studies (AOAS: In revision)
Examples
# 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)