R mediation

mediation is a bootstrapping software for mediation analysis.


Installation

install.packages('mediation')


Usage

library(mediation)

XonM <- lm(M ~ X, data = data)
XMonY <- lm(Y ~ X + M, data = data)

mediate(XonM, XMonY, treat='X', mediator='M', boot=TRUE, sims=500)

This displays:


CategoryRicottone

R/Mediation (last edited 2025-04-03 22:30:13 by DominicRicottone)