cmmb: Compositional Mediation Model for Binary Outcomes

Description Usage Arguments Value Author(s) References Examples

View source: R/cmmb.R

Description

Estimate direct and indirect effects of treatment on binary outcomes transmitted through compositional mediators

Usage

1
2
3
cmmb(Y, M, tr, X, n.cores=NULL, n.boot=2000, ci.method="empirical",
     p.value=FALSE, ForSA=FALSE, max.rho=0.5, sig.level=0.05, FWER=FALSE,
     w=rep(1,length(Y)), prec=1e-4, max.iter=1000)

Arguments

Y

a vector of binary outcomes

M

a matrix of compositional data

tr

a vector of continuous or binary treatments

X

a matrix of covariates

n.cores

a number of CPU cores for parallel processing

n.boot

a number of bootstrap samples

ci.method

options for bootstrap confidence interval. It can be either "empirical" (default) or "percentile".

p.value

a logical value for calculating the p value. It is inactive when ci.method="percentile".

ForSA

a logical value for sensitivity analysis

max.rho

a maximum correlation allowed between mediators and an outcome

sig.level

a significance level to estimate bootstrap confidence intervals for direct and indirect effects of treatment

FWER

a logical value for family-wise error rate for direct and total indirect effects. If FWER=TRUE, the Bonferroni correct will be applied.

w

a vector of weights on samples. If measurements in a sample is more reliable than others, this argument can be used to take that information into the model.

prec

an error tolerance or a stopping criterion for the debiasd procedure

max.iter

a maximum number of iteration in the debias procedure

Note: the range of rho is not from -1 to 1 when the number of components is more than two because the correlation between them is not zero, and the range gets smaller as the number of components increases.

Value

If ForSA=FALSE,

total

contains estimated direct and total indirect effects with their confidence limits

cwprod

contains component-wise products of path coefficients with their confidence limits

If ForSA=TRUE,

total

contains estimated direct and total indirect effects with their confidence limits

cwprod

contains component-wise products of path coefficients with their confidence limits

cide.rho

contains estimated indirect effects and corresponding pointwise 95% confidence intervals, given correlations between mediators and an outcome

Author(s)

Michael B. Sohn

Maintainer: Michael B. Sohn <michael_sohn@urmc.rochester.edu>

References

Sohn, M.B., Lu, J. and Li, H. (2021). A Compositional Mediation Model for Binary Outcome: Application to Microbiome Studies (Submitted)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
# Load a simulated dataset
data(cmmb_demo_data)
# Run CMM for binary outcomes
rslt <- cmmb(Y=cmmb_demo_data$Y, M=cmmb_demo_data$M,
             tr=cmmb_demo_data$tr, X=cmmb_demo_data$X)
rslt
# Plot products of component-wise path coefficients
plot_cw_ide(rslt)

## End(Not run)

mbsohn/cmmb documentation built on Dec. 21, 2021, 3:56 p.m.