Description Usage Arguments Details Value Examples
med_smean
1 2 |
dat |
a dataframe containing the exposure, outcome, mediators, and confounders |
A |
the exposure of interest. Can take any form |
Y |
the outcome, currently must be continuous |
M |
the mediators of interest |
C |
confounders of either X -> M and/or M -> Y. Can take any form |
L |
the exposure-induced confounders of the association of M with Y |
boot |
the number of bootstrap samples used to build confidence intervals |
nmin |
number of participants all categories of exposure must have; samples will be redrawn if this criterion is not met |
mlvl |
the levels of M to calculate corresponding CDE's to. Default is sample average. |
quants |
an optional vector of quantiles for the confidence interval (95 percent by default) |
mids |
an optional mids object to serve as template for imputations |
Returns the controlled direct effect CDE(M) of an exposure A on an outcome Y, not operating through a mediator M, in the case of exposure-induced confounding of the M->Y association. Follows section 5.3.5 of Vanderweele's book on causal mediation analysis.
An S3 object of class cmed_smean
containing:
k2 the coefficient of M in regression of A, M, L and C on Y
k3 the coefficient of A*M from regression of A, M, L and C on Y
g1 the coefficient g1 from the regression of A and C on partial residuals of Y
ymod1 the model of Y for the last bootstrap sample
ymod2 the model of Y residuals for the last bootstrap sample
cde array story controlled direct effects from bootstrapped results
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.