## Question

*"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 33 comments

## By Stephanie on February 3rd, 2015

Thank you so much for your fast response! I would really appreciate it if you could send it to me please. I need to center a lot of variables before I can do anything else...

## By Ruben Geert van den Berg on February 3rd, 2015

Dear Stephanie,

This is one of the older tools and I believe its syntax is more complex than necessary. I'll look into it tomorrow morning and I'll probably rewrite it from scratch. If you'd like me to send you an email if a new version is available, let me know and I'll do so.

## By Stephanie on February 3rd, 2015

Hi! I seem to have the same problem as Denise. I use SPSS 22 and when I try to use the macro clicking on ok (instead of clicking on paste) I always get the "IndexError: list index out of range". When I click on paste instead, it says that SPSS does not recognize the first word of the syntax so it stops. Thank you for your help!

## By Manu on January 24th, 2015

Thanks! Much appreciated.

## By Ruben Geert van den Berg on January 24th, 2015

The mean center Custom Dialog

isan .spd file. Try downloading it again from this link.If that still doesn't work, I'll send the .spd file to you by email if that's ok with you, ok?

HTH,

Ruben