*“I'd like to mean center a lot of variables in order to compute interaction terms for a regression analysis. Is there an easy way to do this for many variables simultaneously?”*

## Mean Centering - What and Why

- This tutorial focuses on
*mean centering variables in SPSS*. However, we'll briefly introduce the concept first. - Mean centering a variable means subtracting its (arithmetic) mean from all its values.
- The result is that a mean centered variable has a mean of exactly zero. (Apart from that, its frequency distribution does not change.)
- Note that mean centering is also one of the two steps in
**standardizing**variables (computing their z-scores). - Mean centering without fully standardizing variables is usually done before computing
**interaction terms**in regression analysis. - Doing so decreases
**multicollinearity**between an interaction term and its corresponding main effects. It may also facilitate the**interpretation**of regression coefficients for the interaction terms.

## SPSS Mean Center Tool

SPSS Mean Center Variables Tool- Make sure you have the SPSS Python Essentials installed.
- Download and install Mean Center Variables. Note this is an SPSS custom dialog.
- Go to . Fill in the names of the variables you’d like to mean center.
- By entering a
**prefix**, mean centered variables will be created as new variables in the active dataset. With the prefix left empty, the original variables will be overwritten by their mean centered counterparts. - Click syntax. and run the pasted
- As a quick check, you could run
`DESCRIPTIVES`

on the mean centered variables to confirm that they all have zero means. - Clicking the tool's button will take you to this tutorial. We very much appreciate your feedback on it.

## This tutorial has 37 comments

## 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.

## 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 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 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 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 lottoo).