Web page to accompany
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, 879-891.
UPDATED April 8th,
2009
Kristopher J. Preacher
Department of Psychology
University of Kansas
Andrew F. Hayes
School of Communication
The Ohio State University
Click here for a copy of the corresponding paper. This paper can be cited as 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, 879-891.
Click here for the SPSS macro command set
Click here for the SAS macro command set
Can’t get the macro to work or have questions? Check here for some macro rules and answers to frequently asked questions.
For supplementary material referred to in the paper, click here.
Join the new Statistical Mediation Analysis group on Facebook.
The macro described here is used to generate estimates for indirect effects in a multiple mediator model of the form in Figure 1, where c is the total effect of X on Y, c′ is the direct effect of X on Y, and the specific indirect effect of X on Y through mediatior Mi is defined as aibi. This macro can do everything that our simple mediation macro can do (Preacher & Hayes, 2004, Behavior Research Methods, Instruments, and Computers, 36, 717-731), except this one allows for multiple mediators, statistical control of covariates, all possible pairwise comparisons between indirect effects, and it produces bias-corrected and bias-corrected and accelerated bootstrap confidence intervals in addition to percentile-based bootstrap confidence intervals. Thus, this macro is far superior to our earlier macro.

Figure 1. A multiple mediator model
As with all macros, the macro syntax must first be run in order to “activate” the macro. Once the macro is activated, it will remain active until you quit the SPSS or SAS session. The macro procedure is executed with the syntax and arguments described below.
The macro will use listwise deletion to remove cases with missing data. Listwise deletion cannot be overridden.
NEW: As of April 8, 2009, the
INDIRECT macro and script for SPSS (but not SAS) works with dichotomous outcome
variables (Y only). See the INDIRECT syntax reference for details.
A script of the INDIRECT macro is
available. The script has all the
functionality of the INDIRECT macro but uses a Windows-style dialog box for
selection of variables and options (see below).
A copy of the script can be downloaded here. It can be
opened from within SPSS as a script (.sbs file type) and then run from the
scripting window. The dialog box below
will pop open. A data file must be
opened prior to executing the script or the script will terminate. Here is a document on opening
and running scripts in SPSS.

INDIRECT SPSS Script Dialog Box
Syntax structure for SPSS version
See the INDIRECT syntax
reference [PDF]
Syntax
for SAS version
The SAS version of the macro functions identically to the SPSS version,
except that the SAS version should not be used with dichotomous Y. The macro accepts missing data as “.” and will
use listwise deletion to exclude cases with missing data. After the SAS macro command set is run, the
macro syntax is
%indirect
(data=filename,y=dv,x=iv,m=mlist covlist,c=cov,boot=z,conf=ci,
normal=n,contrast=t,percent=p,bc=b,bca=d);
where filename is the name of an SPSS file name and the
remaining arguments are defined as in the SPSS instructions above. The SAS macro command corresponding to the
SPSS example above is
%indirect
(data=example,y=satis,x=treat,m=sessions affect sex age,c=2,boot=5000,conf=90,
contrast=1,percent=1,bc=1,bca=0);
where example is
the name of the SAS datafile. The z
bootstrap estimates will be saved in a SAS data file named bootstp.
DISCLAIMER: As with all statistical software, all attempts are made to make sure that the computations programmed into this macro are being performed correctly. When bugs are found and reported, I attempt to eliminate them as quickly as possible. I offer these macros to the research community “as is” and accept no responsibility for any negative consequences that might result from their use. In other words, use at your own risk.