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 July 2,
2008
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? Check here.
For supplementary material referred to in the paper, click here.
OSU Graduate Students: Take a class on mediation from me this Fall.
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 system missing data (generally represented in the data file as a period (“.”). Listwise deletion cannot be overridden. The macro does not accept user-defined missing data, so the data file should be purged of cases with user-defined missing data prior to running the macro
Syntax
for SPSS version [PDF]
The SPSS version of the macro has the following syntax
INDIRECT y = dv/x = iv/m = mlist covlist/c = cov/boot = z/conf = ci/
/normal = n/contrast = t/percent = p/bc = b/bca = d
where dv is the name of the dependent variable (Y in figure 1), iv is the name of the independent variable (X in Figure 1), and mlist is a list of mediator variables (Mi in figure 1). These are the only arguments that are necessary for execution of the macro. If no other options are provided, the macro will estimate the paths in the model (using OLS) assuming no control variables, the number of bootstraps will be set to 1000, the confidence level will default to 95, only bias corrected and adjusted confidence intervals for the indirect effects will be printed, and no normal theory results or pairwise contrasts are conducted. For more options, the following arguments are used:
covlist is a list of covariate variables, and cov is the number of covariate variables in the covlist list, z is the number of desired bootstrap resamples desired in increments of 1000 (e.g., boot = 2000 yields 2000 bootstrap resamples; set it to 0 to disable bootstrapping), ci is the desired confidence level, p is set to 1 to print percentile-based confidence intervals, b is set to 1 to print bias-corrected confidence intervals, d is set to 0 to disable printing of bias corrected and adjusted confidence intervals, n is set to 1 to enable printing of normal theory test results, and t is set to 1 to do all possible pairwise contrasts between indirect effects. If any of these arguments are not provided, default values will be used (the defaults are c = 0, z = 1000, ci = 95, p = 0, b =0, d = 1, n = 0, t = 0). Note that if c is set to 0 it is assumed that there are no variables listed in covlist, and all variables listed after “m =” are treated as potential mediators.
If covariates are provided, normal theory results will not be printed.
For example, the command below will estimate the total, direct, and indirect effects of TREAT on SATIS through SESSIONS and AFFECT, controlling for SEX and AGE, using 5000 bootstrap resamples to generate 90% confidence intervals, all possible pairwise comparisons between indirect effects (only one possible comparison in this example) and printing percentile and bias-corrected confidence intervals only.
INDIRECT Y = SATIS/X = TREAT/M = SESSIONS AFFECT SEX
AGE/C = 2/BOOT = 5000/CONF = 90/CONTRAST = 1/PERCENT = 1
/BC = 1/BCA = 0.
The z bootstrap estimates will be saved to a data file named INDIRECT.SAV. You can use this to examine the bootstrap sampling distributions.
Syntax
for SAS version
The SAS version of the macro functions identically to the SPSS
version. 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.