UCLA Academic Technology Services HomeServicesClassesContactJobs
Help the Stat Consulting Group by giving a gift             
Loading

SPSS FAQ
How can I analyze multiple mediators in SPSS?

This page uses code by Kristopher J. Preacher of the University of Kansas and Andrew F. Hayes of Ohio State University. The code can be found on the webpage accompanying their paper:

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.

To use the Preacher and Hayes's script, first download the .sbs file found 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: 
 
Dependent, Independent, and Proposed Mediator Variables: 
DV =   science 
IV =   math 
MEDS = read 
       write 
 
Sample size 
        200 
 
IV to Mediators (a paths) 
          Coeff        se         t         p 
read      .7248     .0583   12.4378     .0000 
write     .6247     .0566   11.0452     .0000 
 
Direct Effects of Mediators on DV (b paths) 
          Coeff        se         t         p 
read      .3015     .0687    4.3903     .0000 
write     .2065     .0708    2.9185     .0039 
 
Total Effect of IV on DV (c path) 
         Coeff        se         t         p 
math     .6666     .0583   11.4371     .0000 
 
Direct Effect of IV on DV (c-prime path) 
         Coeff        se         t         p 
math     .3190     .0767    4.1605     .0000 
 
Model Summary for DV Model 
      R-sq  Adj R-sq         F       df1       df2         p 
     .4999     .4923   65.3187    3.0000  196.0000     .0000 
 
****************************************************************** 
 
           NORMAL THEORY TESTS FOR INDIRECT EFFECTS 
 
Indirect Effects of IV on DV through Proposed Mediators (ab paths) 
         Effect        se         Z         p 
TOTAL     .3476     .0596    5.8277     .0000 
read      .2186     .0524    4.1692     .0000 
write     .1290     .0454    2.8422     .0045 
 
***************************************************************** 
 
           BOOTSTRAP RESULTS FOR INDIRECT EFFECTS 
 
Indirect Effects of IV on DV through Proposed Mediators (ab paths) 
           Data      boot      Bias        SE 
TOTAL     .3476     .3449    -.0027     .0645 
read      .2186     .2164    -.0022     .0537 
write     .1290     .1285    -.0005     .0496 
 
Bias Corrected and Accelerated Confidence Intervals 
          Lower     Upper 
TOTAL     .2230     .4700 
read      .1125     .3245 
write     .0294     .2235 
 
***************************************************************** 
 
Level of Confidence for Confidence Intervals: 
  95 
 
Number of Bootstrap Resamples: 
  1000 
 
------ 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 and kurtotic. 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: 
 
Dependent, Independent, and Proposed Mediator Variables: 
DV =   science 
IV =   math 
MEDS = read 
       write 
 
Statistical Controls: 
CONTROL= socst 
 
Sample size 
        200 
 
IV to Mediators (a paths) 
          Coeff        se         t         p 
read      .5038     .0634    7.9512     .0000 
write     .4144     .0617    6.7112     .0000 
 
Direct Effects of Mediators on DV (b paths) 
          Coeff        se         t         p 
read      .3100     .0729    4.2517     .0000 
write     .2149     .0748    2.8723     .0045 
 
Total Effect of IV on DV (c path) 
         Coeff        se         t         p 
math     .5671     .0684    8.2863     .0000 
 
Direct Effect of IV on DV (c-prime path) 
         Coeff        se         t         p 
math     .3218     .0773    4.1654     .0000 
 
Partial Effect of Control Variables on DV 
          Coeff        se         t         p 
socst    -.0227     .0645    -.3519     .7253 
 
Model Summary for DV Model 
      R-sq  Adj R-sq         F       df1       df2         p 
     .5003     .4900   48.8010    4.0000  195.0000     .0000 
 
***************************************************************** 
 
           BOOTSTRAP RESULTS FOR INDIRECT EFFECTS 
 
Indirect Effects of IV on DV through Proposed Mediators (ab paths) 
           Data      boot      Bias        SE 
TOTAL     .2452     .2439    -.0014     .0478 
read      .1562     .1539    -.0023     .0413 
write     .0891     .0900     .0009     .0342 
 
Bias Corrected and Accelerated Confidence Intervals 
          Lower     Upper 
TOTAL     .1597     .3522 
read      .0863     .2476 
write     .0311     .1671 
 
***************************************************************** 
 
Level of Confidence for Confidence Intervals: 
  95 
 
Number of Bootstrap Resamples: 
  1000 
 
------ END MATRIX -----

How to cite this page

Report an error on this page or leave a comment

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.