# Continuous variables interaction in regression using SPSS

### Step 1: Centre the predictors

To create a centred variable in SPSS, one option is to use syntax. Note that SPSS isn’t vectorised and so a bit of a workaround is needed to subtract the sample mean of a variable from each individual participants’ score.

```
* Create a constant variable to aggregate across all cases.
COMPUTE const = 1.
* Aggregate to calculate the mean of Openness for all cases.
AGGREGATE
/OUTFILE=* MODE=ADDVARIABLES
/BREAK=const
/Openness_mean = MEAN(Openness).
* Compute the centred Openness variable by subtracting its mean from each score.
COMPUTE Openness_Centred = Openness - Openness_mean.
* Execute the commands to apply the calculations.
EXECUTE.
```

If you prefer the graphical user interface, first get the means for each variable you need to centre (your predictors in this case):

Then use Transform $\rightarrow$ Compute to calculate the centred version of each variable:

### Step 2: Calculate the interaction term

Calculate the product (interaction) variable. Again, use Compute, either in syntax or the GUI:

```
COMPUTE Open_Agree_C_Prod=Openness_Centred * Agreeableness_Centred.
EXECUTE.
```

### Step 3: Run the regression

Add both predictors, along with the interaction term, something like this:

If your interaction (product) term is contributing significantly to the model, then the level of one predictor affects the relationship between the other predictor and the predicted (dependent) variable. In other words, you have an interaction.

### Step 4: Graph the results

```
RECODE Agreeableness_Centred (Lowest thru -.737=1) (-.737 thru .737=2) (.737 thru Highest=3) INTO
Agreeableness_C_buckets.
EXECUTE.
```