Also see SPSS Moderation Regression Tutorial.
- Regression with Moderation Effect
- Downloading and Installing the Mean Centering Tool
- Using the Mean Centering Tool
- Mean Centering Tool - Results
A sports doctor wants to know if and how training and age relate to body muscle percentage. His data on 243 male patients are in muscle-percent-males.sav, part of which is shown below.
Regression with Moderation Effect
The basic way to go with these data is to run multiple regression with age and training hours as predictors. However, our doctor expects a moderation interaction effect between age and training. Precisely, he believes that the effect of training on muscle percentage diminishes with age. The diagram below illustrates the basic idea.
The moderation effect can be tested by creating a new variable that represents this interaction effect. We'll do just that in 3 steps:
- mean center both predictors: subtract the variable means from all individual scores. This results in centered predictors having zero means.
- compute the interaction predictor as the product of the mean centered predictors;
- run a multiple regression analysis with 3 predictors: the mean centered predictors and the interaction predictor.
Steps 1 and 2 can be done with basic syntax as covered in How to Mean Center Predictors in SPSS? However, we'll present a simple tool below that does these steps for you.
Downloading and Installing the Mean Centering Tool
First off, you need SPSS with the SPSS-Python-Essentials for installing this tool. The tool is downloadable from SPSS_TUTORIALS_MEAN_CENTER.spe.
After downloading it, open SPSS and navigate to
as shown below.
For older SPSS versions, try You may need to run SPSS as an administrator (by right-clicking its desktop shortcut) in order to install any tools.
Using the Mean Centering Tool
First open some data such as muscle-percent-males.sav. After installing the mean centering tool, you'll find it in the menu.
This opens a dialog as shown below. Note that string variables don't show up here: these need to be converted to numeric variable before they can be mean centered.
Variable names for the centered predictors consist of a prefix + the original variable names. In this example, mean centered age and thours will be named cent_age and cent_thours.
Optionally, create new variables holding all 2-way interaction effects among the centered predictors. For 2 predictors, this results in only 1 interaction predictor.
Clicking results in the syntax below. Let's run it.
SPSS_TUTORIALS_MEAN_CENTER VARIABLES = "age thours"
/OPTIONS PREFIX = cent_ CHECKTABLE INTERACTIONS.
Mean Centering Tool - Results
In variable view, note that 3 new variables have been created (and labeled). Precisely these 3 variables should be entered as predictors into our regression model.
If a checktable was requested, you'll find a basic Descriptive Statistics table in the output window.
Note that the mean centered predictors have exactly zero means. Their standard deviations, however, are left unaltered by the mean centering -which is precisely how this procedure differs from computing z-scores.
Right, so that'll do for our mean centering tool. We'll cover a regression analysis with a moderation interaction effect in 1 or 2 weeks or so.
Thanks for reading!
THIS TUTORIAL HAS 40 COMMENTS:
By Ruben Geert van den Berg on February 24th, 2015
@Frank: note that there's two separate steps involved: first you need to have SPSS and the SPSS Python Essentials installed and running. Second, you need to download and install the SPSS Custom Dialog from this tutorial. Now you should find "Mean Center Variables" under "Utilities".
If that still doesn't work, please get back at me, OK? Perhaps the syntax for this particular case isn't too hard but there's plenty more handy custom dialogs (we actually use our own custom dialogs a lot too).
By Stephanie on March 4th, 2015
@Ruben Geert van den Berg
Yes, I get the same error when I run the Python test. I tried googling how to fix this, but I am fairly computer illiterate and quickly got confused :) Any advice or pointing me in the right direction would be much appreciated. Thank You!
By Ruben Geert van den Berg on March 4th, 2015
@Stephanie: the standard advice here is to uninstall and reinstall the SPSS Python Essentials. Which version are you on? You can see this by navigating to Help => About
By Cole Robertson on April 27th, 2015
Hi, could you please tell me how to uninstall this custom dialog? It is causing my SPSS (22, Mac OSX) to crash and burn every time I try to open a new syntax window.
By Ruben Geert van den Berg on April 27th, 2015
I'm not familiar with MAC OSX but I'll try to assist anyway: have you used (other) custom dialogs previously without these symptoms?
When clicking OK in a custom dialog, it opens and runs a hidden syntax window. A known problem is that later syntax is sometimes pasted in this hidden window so it seems as if "paste" doesn't work anymore. Please note that this problem is related to SPSS, not the custom dialogs themselves. The workaround for this is to first open an empty new syntax window, then use "paste" instead of "ok" in the custom dialog. If your problems are related to this, please give that a try.
Uninstalling custom dialogs is not obvious at all but please try the following (works for Windows): first try and reinstall the custom dialog (.spd file).
Upon doing so successfully, you'll get a small pop up notification window that says that "the custom dialog has been installed in...". This will tell you where it's been installed (for SPSS 22 on Windows, it's something like C:\Users\[user]\AppData\Local\IBM\SPSS\Statistics\22\CustomDialogs).
Entirely deleting the custom dialog's subfolder from here should uninstall it.
I'd really appreciate if you'd let me know whether this got you any further. Even though I'm not on a MAC myself, I do want to support MAC users as well as I can.