*“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 Manu on January 23rd, 2015

Hello,

Need help for installing the Mean Centre variable utility. The downloaded files include an XML file with the code for the utility. But there is no .spd file. How do I install this?

Thanks!

## By Ruben Geert van den Berg on October 24th, 2014

Is there any way you could share (a sample of) the data and syntax that triggers the error, perhaps by email? I really need some more detail in order to see what's going on.

## By Michael on October 23rd, 2014

I use spss 22. Yesterday, the mean center utility worked fine. Today, I always get "IndexError..." (using same syntax and same data file)... Do you have any ideas?

## By Ruben Geert van den Berg on October 16th, 2014

I just redownloaded and retested the tool and it works fine on my system (version 22 as well). In order to track down your issue, I'll need some more information, ideally a sample of the data. Could you email me on this?

## By Denise on October 15th, 2014

Thank you for creating this macro, but with my spss22 it does not work...I always get "IndexError: list index out of range". Can you possibly help me?