# Multiple mediation analysis in R

I am wondering if anyone knows of a way to run a multiple mediation model in R. I know the mediation package allows for multiple simple mediation models, but I want to run one model that evaluates multiple mediation models simultaneously.

I am assuming I can do this in an SEM framework (path analysis), but was wondering if anyone new of a package that computed statistics typical of mediation analysis for multiple mediators (indirect effects, Proportion of Total Effect via Mediation, etc.), and could utilize bootstrapping. I know this is a long-shot, but thought I should ask before investing time developing from scratch.

UPDATE: (11/11/2013)

Since asking this question a couple of years ago, I have learned to use the wonderful R package lavaan to do multiple mediation.

here is example code:

model <- '
# outcome model
outcomeVar ~ c*xVar + b1*medVar1 + b2*medVar2

# mediator models
medVar1 ~ a1*xVar
medVar2 ~ a2*xVar

# indirect effects (IDE)
medVar1IDE  := a1*b1
medVar2IDE  := a2*b2
sumIDE := (a1*b1) + (a2*b2)

# total effect
total := c + (a1*b1) + (a2*b2)
medVar1 ~~ medVar2 # model correlation between mediators
'


Note that a1,a2,b1,b2, and c are labels. Then run the model:

fit <- sem(model, data=dataframe)


And look at output:

summary(fit, fit.measures=TRUE, standardize=TRUE, rsquare=TRUE)


Finally, generate bootstrap confidence intervals:

boot.fit <- parameterEstimates(fit, boot.ci.type="bca.simple")


See the lavaan website for more details: http://lavaan.ugent.be/

• Not sure whether the semPLS or plspm would allow mediational analysis, but it's worth to check. – chl Dec 9 '11 at 16:04
• @wmmurrah will piggyback on your question, is the only advantage of bootstraping to obtain the confidence intervals? – lf_araujo Jul 3 '17 at 2:19
• @If_araujo If you are into hypothesis testing, the bootstrap confidence intervals should be used instead of the p-values as the latter require normality assumptions that are often violated. The indirect effect, which are the product of two path coefficients, tend to be skewed, making the assumptions of p-values questionable, unless they are large. So even if you do not want to use the intervals they are superior to the p-values. – wmmurrah Jul 4 '17 at 14:15
• @ If_araujo see: See: Preacher, K. J., & Hayes, A. F. (2008). Asymptotic and resampling strategies for assessing and comparing indirect effects in multiple mediator models. Behavior research methods, 40(3), 879-891. – wmmurrah Jul 4 '17 at 14:17