Description Usage Arguments Value Examples
med_reg Gives controlled direct effect, natural indirect effect, natural direct effect using regression-based formulas
affording the best statistical power. The procedure is described in chapter 3.1.1 of Tyler's book
1 2  | 
df | 
 Data frame  | 
X | 
 exposure, can be continuous or categorical  | 
M | 
 mediator, must be continuous for the moment  | 
Y | 
 outcome, must be continuous for the moment  | 
C | 
 confounders of exposure-outcome or mediator-outcome association. Can take any form  | 
noint | 
 supress exposure-mediator interaction term  | 
mlvl | 
 vector of values at which to compute a controlled direct effect  | 
delta | 
 whether the delta method should be used to get confidence intervals  | 
ref | 
 referent level of exposure, 0 by default  | 
treat | 
 treatment level of exposure, 1 by default  | 
a list composed of the natural direct effect, natural indirect effect, total effect, and a controlled
direct effect for each line given in mlvl
1 2 3 4 5 6 7 8  | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.