views:

266

answers:

1

I'd like to know if anybody can provide a step-by-step how to on how to use mediation analysis using Keele, Tingley, Yamamoto and Imai's mediation package. I think there are two approaches to this - the classic Baron and Kenny (1986) and the new one by Preacher, Rucker and Hayes (2007) - I'd like to know how to do both approaches in R

+4  A: 

In case you not familiar with R and packages, start with

install.packages(mediation)

to download and install the package from CRAN. Then do

library(help=mediation)

for a high-level view of the package, and available help files. Then use

library(mediation)
help(mediate)

to load the package and read the help page. The example can be run via

example(mediate)

and you can run the other example for sensitivity analysis via

example(medsens)
Dirk Eddelbuettel
@Dirk I've actually done this already - do you recommend any test dataset that I can run the mediation package on?
pageman