This workshop is intended to introduce the use of the Process macro for SPSS. The Process macro was written by Andrew F. Hayes.

## Some Terms

**Moderation:** Moderation refers to an interaction. A moderator variable is a variable that
interacts with another variable, often with an independent or predictor variable. If two
variables A and B interact, then the effect of A depends on the value of B.

**Mediation:** In mediation the effect of one variable is transmitted to another variable
through the mediator variable. For example the effect of X is transmitted to Y through
variable M.

This can be seen in the diagram below of a classical mediation model (adapted from Baron & Kenny, 1986). In the diagram “a” is the regression coefficient predicting M by X. “b” is the coefficient predicting Y by M, And, “c'” is the coefficient predicting Y from X.

**Partitioning the Effect of X on Y:** In a mediation model the effect of variable X on Y can
be partitioned into two parts: 1) the direct effect of X on Y, and 2) the indirect effect of
X on Y via the mediator M. Combined, the direct and indirect effect of X on Y is known as
the total effect.

**Direct Effect:** The direct effect is the effect of X on Y when the mediator
is included in the model. In the diagram above the direct effect is shown as “c’.”

**Indirect Effect:** The indirect effect is a measure of how much of the effect
of X on Y that is being mediated. Another term for the indirect effect is the mediation effect.

In a classical mediation model the indirect effect is obtained by multiplying the “a” coefficient times the “b” coefficient in the diagram above.

**Conditional Indirect Effects:** When the size of an indirect effect depends
on the values of another variable, we call this a conditional indirect effect. Basically,
there is an interaction in the model that affects the indirect effect. Collectively,
we refer to these types of models as moderated mediation.

## About the Process Macro

The Process macro will will compute models with continuous or binary outcome variables. The primary predictor variable (IV) and the mediator variable must be continuous. The macro will not work correctly if the primary predictor is categorical and will not run if the mediation variable is categorical.

## How to get and install the Process macro

1) Go to Andrew Hayes’ webpage,
http://afhayes.com/spss-sas-and-mplus-macros-and-code.html

2) Download the process macro.

3) Paste the macro into a syntax window.

4) Run the macro from the syntax window.

## Using the Process macro

There are two ways to use the Process macro. Process can be used with point-and-click module that needs to be downloaded or it can be used directly from the SPSS syntax window. We will demonstrate the Process macro using the syntax method.

You begin by entering the command “process” followed by the keyword “vars =”. This is where you list all of the variables to be used in the analysis. The keywords “y”, “x”, and “m” are used for the response variable, the predictor variable and the mediator variable, respectively. The moderator variable for moderated mediation will be “w” or “v” depending on the model. Finally, it is very important to include the model number after the “model = “.

The model number can be found in an appendix of Hayes’ book or in a pdf file of model templates found on the author’s website.

Process does not output a t-statistic or p-value for the indirect effect. Rather, Process bootstraps (resamples) the indirect effect and outputs a 95% confidence interval. A hypothesis can be made by determining whether zero falls inside the confidence interval. If the interval includes zero then the indirect effect is not significant at the 0.05 level. If zero is not in the interval then the indirect effect is statistically significant at the 0.05 level.

## The data

We will demonstrate the Process macro using the http://stats.idre.ucla.edu/wp-content/uploads/2016/02/mediation_data.sav dataset. The file
has five continuous standardized test scores; **read**, **write**,
**math**, **science** and **socst**. It
also has a binary variable, **hisci**, which is an indicator of a high
science score. With the exception of the first example, the response variable with be
either **science** or **hisci**. Again, except for the first
example, we will use **math** as the predictor variable and **read**
as the mediator.

## Example 1: Moderation

In this example, there is an interaction between the predictor, X and the moderator, M.
For this example, the dependent or response variable is **read**; the independent or predictor
variable is **socst**;
and the moderator is **math**. Here is a block diagram of a model with a moderator variable.

* Example 1 (Process model 1).process vars = socst read math / y = read / x = socst / m = math / model = 1.

## Example 2: Classical Mediation

In this example, the DV is **science** and the IV is **math**; **read** is the mediator. Here is a block
diagram of a simple classical mediation.

* Example 2 (Process model 4).process vars = science read math / y = science / x = math / m = read / model = 4.

## Example 3: Moderated Mediation

This example has the same variables as the previous model with the addition of an interaction between the IV and the mediator. Here is a block diagram of the model.

* Example 3 (Process model 74).process vars = science read math / y = science / x = math / m = read / model = 74.

## Example 4: Moderated Mediation

This example has the same variables as the previous model with the addition of an interaction between the IV and the mediator. Here is a block diagram of the model.

* Example 4 (Process model 8).process vars = science read math write / y = science / x = math / m = read / w = write / model = 8.

## Example 5: Moderated Mediation

This time there is an interaction between the MV and the mediator. Here is a block diagram of the model.

* Example 5 (Process model 14).process vars = science read math write / y = science / x = math / m = read / v = write / model = 14.

## Example 6: Simple Mediation with Binary DV

In this example, the DV and IV are the same; and read is the mediator. The block diagram is the same as example 2.

* Example 6 (Process model 4).process vars = hisci read math / y = hisci / x = math / m = read / model = 4.

## Example 7: Moderated Mediation with Binary DV

This example has the same variables as the previous model with the addition of an interaction between the IV and the mediator. The block diagram is the same as for Example 3.

* Example 7 (Process model 74).process vars = hisci read math write / y = hisci / x = math / m = read / model = 74.

## Example 8: Moderated Mediation with Binary DV

This example has the same variables as the previous model with the addition of an interaction between the IV and the mediator. The block diagram is the same as for Example 4.

* Example 8 (Process model 8).process vars = hisci read math write / y = hisci / x = math / m = read / w = write / model = 8.

## Example 9: Moderated Mediation with Binary DV

This example has the same variables as the previous model with the addition of an interaction between the IV and the mediator. The block diagram is the same as for Example 5.

* Example 9 (Process model 14).process vars = hisci read math write / y = hisci / x = math / m = read / v = write / model = 14.

## Beyond Process

The Process macro computes the indirect effect by calculating the product of coefficients. This method works well when the mediator and response variables are continuous. However, when the mediator is binary or the response variable is a count variable (Poisson or negative binomial) the product of coefficients approach does not work. In general, the product of coefficients method does not work with nonlinear models.

An alternative method is to use a causal mediation approach which involves the use of counterfactuals. Programs that do causal mediation can be found in R, SAS, Stata and Mplus. At the current time there are no macros for causal mediation in SPSS.

Additionally, the Process macro cannot be used with multilevel models. Multilevel mediation is a much more complex analysis which goes beyond the scope of this workshop.

## Reference

Hayes, A. F. 2013. *Introduction to Mediation, Moderation and Conditional Process
Analysis.* New York, New York: Guilford Press.