Next Upcoming Google+ Hangout: Tuesday, August 27 @ 7PM (CST) - To Participate CLICK HERE

Search For Topics/Content

SPSS Topics Discussion > Centering a variable in SPSS

Hi Jeremy,
This is a great website!

I was wondering if you know of a SPSS syntax command, or any other alternative to using COMPUTE option in the pull down menu, to center a variable. Even though, it is generally not that hard to use compute to subtract the mean, I always wonder if there is a more efficient and quicker way to center a variable in SPSS. Thank you for your help!

June 28, 2011 | Unregistered CommenterDina

Great question Dina!

There isn't a direct command to center data in SPSS syntax (at least not that I know about), but there are ways that you can accomplish the task with syntax, which I'll be happy to try and explain. Before I do though, it must ask what kind of centering you are trying to accomplish? This is critical, as different types would require different syntax. Some options are: "grand mean centering", "group mean centering"...etc

What did you have in mind?

June 29, 2011 | Registered CommenterJeremy Taylor

I guess I would like to learn both grand-mean and group-mean centering...if that is ok:)

June 30, 2011 | Unregistered CommenterDina

Hi Dina!

SPSS doesn't have a specific command to center a variable (to my knowledge), but you can write syntax to accomplish the task (kind-of a work around). I'll post a link below that will allow you to download an example SPSS syntax file that you can use as a template by simply replacing "XXXX" with your variable names. There are instructions in the file to perform both a "grand mean" centering and a "group mean" centering. I hope this helps and please let me know if you have more questions!

CLICK TO DOWNLOAD EXAMPLE SYNTAX FILE

July 6, 2011 | Registered CommenterJeremy Taylor

I will give it a try. Thank you much!

July 7, 2011 | Unregistered CommenterDina

My pleasure! Please let me know either way, whether it works or not! I'm always looking for ways to improve my syntax!

July 9, 2011 | Registered CommenterJeremy Taylor

Hi, Your syntax worked great. I tested it out with many different variables
Thanks Jeremy!

September 22, 2011 | Unregistered CommenterTracy

I'm glad it was helpful, Tracy!

September 29, 2011 | Registered CommenterJeremy Taylor

hi is it possible to have the syntax file ? I am trying to center some of my data and I am struggling... thank you

February 8, 2012 | Unregistered Commentermeltem

Dear Meltem (and others),

I actually hadn't realized that my previously posted link to the syntax was no longer working, so thank you for bringing that to my attention. If you click it now, it should be working again and should either download a file or take you to a page with text that can be copied into a syntax (depending on your browser).

Also, here is the link a second time:

CLICK TO DOWNLOAD EXAMPLE SYNTAX FILE

February 15, 2012 | Registered CommenterJeremy Taylor

Thanks Agnes!

July 15, 2012 | Registered CommenterJeremy Taylor

Hi Jeremy,
I just clicked on both links to download the syntax but both of them seem broken. They re-routed me to a dropbox page but mentions a 404 error.
Would you be able to post it again?
Would be most appreciated!

Thanks!

August 13, 2012 | Unregistered CommenterChris

Hey Chris (and anyone else trying to obtain the syntax),

Sorry for the broken links, dropbox seems to be giving me problems lately. Try this link:

CLICK HERE TO DOWNLOAD SYNTAX

August 27, 2012 | Registered CommenterJeremy Taylor

Thanks Jeremy! You're a life saver :D

September 30, 2014 | Unregistered CommenterShelter

Awesome, thank you!!!

December 8, 2015 | Unregistered Commenterteacherusa

Thank you!!!!

January 25, 2016 | Unregistered CommenterCatheryn

hi Jeremy Taylor, I triesd to use your SPSS syntax but it did not worked, I do not understand why?

August 29, 2016 | Unregistered Commentereda manuoğlu