This page uses code from the PROCESS macro written by Kristopher J. Preacher of the University of Kansas and Andrew F. Hayes of Ohio State University.

To use the Preacher and Hayes’s script, first download the .sbs or .spd file. The link for the documentation describing how to download and install the .sbs file as well as the dialogue box (.spd file) is here. Then open it in SPSS and run it by clicking on the green arrow or choosing “Run” from the Macro menu. This will open an SPSS dialog window.

## Example 1: Multiple mediators

For this example, we will use the hsb2 dataset with **science** as
the dependent variable, **math** as the independent variable and **read**
and **write** as the two mediator variables. The paths in such a model are
depicted below. In our analysis, we are interested in finding these paths to
calculate the direct and indirect effects of our variables.

To begin, we indicate which of our variables are the dependent, independent, and mediator variables in the dialog window.

This generates the output below.

Run MATRIX procedure: ************* PROCESS Procedure for SPSS Release 2.16.1 ****************** Written by Andrew F. Hayes, Ph.D. www.afhayes.com Documentation available in Hayes (2013). www.guilford.com/p/hayes3 ************************************************************************** Model = 4 Y = science X = math M1 = read M2 = write Sample size 200 ************************************************************************** Outcome: read Model Summary R R-sq MSE F df1 df2 p .6623 .4386 59.3124 154.6991 1.0000 198.0000 .0000 Model coeff se t p LLCI ULCI constant 14.0725 3.1158 4.5165 .0000 7.9281 20.2170 math .7248 .0583 12.4378 .0000 .6099 .8397 ************************************************************************** Outcome: write Model Summary R R-sq MSE F df1 df2 p .6174 .3812 55.8721 121.9967 1.0000 198.0000 .0000 Model coeff se t p LLCI ULCI constant 19.8872 3.0241 6.5762 .0000 13.9236 25.8508 math .6247 .0566 11.0452 .0000 .5132 .7362 ************************************************************************** Outcome: science Model Summary R R-sq MSE F df1 df2 p .7071 .4999 49.7696 65.3187 3.0000 196.0000 .0000 Model coeff se t p LLCI ULCI constant 8.4074 3.1928 2.6332 .0091 2.1107 14.7040 read .3015 .0687 4.3903 .0000 .1661 .4370 write .2065 .0708 2.9185 .0039 .0670 .3461 math .3190 .0767 4.1605 .0000 .1678 .4702 ******************** DIRECT AND INDIRECT EFFECTS ************************* Direct effect of X on Y Effect SE t p LLCI ULCI .3190 .0767 4.1605 .0000 .1678 .4702 Indirect effect of X on Y Effect Boot SE BootLLCI BootULCI TOTAL .3476 .0667 .2153 .4701 read .2186 .0553 .1076 .3265 write .1290 .0488 .0427 .2321 ******************** ANALYSIS NOTES AND WARNINGS ************************* Number of bootstrap samples for bias corrected bootstrap confidence intervals: 1000 Level of confidence for all confidence intervals in output: 95.00 ------ END MATRIX -----

The results above assuming normality suggest that each of the separate indirect effects as well as the total indirect effect are significant. From the above results it is also possible to compute the ratio of indirect to direct effect (.3476/.3190 = 1.09) and the proportion of the total effect due to the indirect effect (.3476/(.3476 + .3190) = .52).

The normal theory tests for indirect effects compute the standard errors using the delta method which assumes that the estimates of the indirect effect are normally distributed. For many situations this is acceptable, but it does not work well for the indirect effects which are usually positively skewed. Thus the z-test and p-values for these indirect effects generally cannot be trusted. Therefore, it is recommended that bootstrap standard errors and confidence intervals be used. Additionally, if your outcome is binary, a proportion, or a percent, bootstrap estimates should be used. These can be found in the next block of output. These standard errors are slightly larger than those calculated assuming normality and the overall interpretation remains the same.

## Example 2: Multiple mediators with control variable(s)

What do you do if you also have control variables? You add them as covariates
to the model. Let’s say that **socst** is a covariate. We can see the new
results below.

Run MATRIX procedure: ************* PROCESS Procedure for SPSS Release 2.16.1 ****************** Written by Andrew F. Hayes, Ph.D. www.afhayes.com Documentation available in Hayes (2013). www.guilford.com/p/hayes3 ************************************************************************** Model = 4 Y = science X = math M1 = read M2 = write Statistical Controls: CONTROL= socst Sample size 200 ************************************************************************** Outcome: read Model Summary R R-sq MSE F df1 df2 p .7317 .5354 49.3405 113.4903 2.0000 197.0000 .0000 Model coeff se t p LLCI ULCI constant 7.1465 3.0407 2.3503 .0197 1.1501 13.1430 math .5038 .0634 7.9512 .0000 .3789 .6288 socst .3541 .0553 6.4044 .0000 .2451 .4632 ************************************************************************** Outcome: write Model Summary R R-sq MSE F df1 df2 p .6956 .4838 46.8487 92.3152 2.0000 197.0000 .0000 Model coeff se t p LLCI ULCI constant 13.2949 2.9629 4.4871 .0000 7.4518 19.1379 math .4144 .0617 6.7112 .0000 .2926 .5362 socst .3371 .0539 6.2559 .0000 .2308 .4433 ************************************************************************** Outcome: science Model Summary R R-sq MSE F df1 df2 p .7073 .5003 49.9931 48.8010 4.0000 195.0000 .0000 Model coeff se t p LLCI ULCI constant 8.5657 3.2314 2.6507 .0087 2.1926 14.9388 read .3100 .0729 4.2517 .0000 .1662 .4538 write .2149 .0748 2.8723 .0045 .0673 .3625 math .3218 .0773 4.1654 .0000 .1694 .4742 socst -.0227 .0645 -.3519 .7253 -.1500 .1046 ******************** DIRECT AND INDIRECT EFFECTS ************************* Direct effect of X on Y Effect SE t p LLCI ULCI .3218 .0773 4.1654 .0000 .1694 .4742 Indirect effect of X on Y Effect Boot SE BootLLCI BootULCI TOTAL .2452 .0504 .1545 .3427 read .1562 .0414 .0843 .2468 write .0891 .0362 .0253 .1669 ******************** ANALYSIS NOTES AND WARNINGS ************************* Number of bootstrap samples for bias corrected bootstrap confidence intervals: 1000 Level of confidence for all confidence intervals in output: 95.00 ------ END MATRIX -----