5 Reasons to use SPSS Syntax

by Karen Grace-Martin

You don’t do all your data analysis in SPSS menus, right?  (Please, please tell me you don’t).

There’s really nothing wrong with using the menus.  It’s a great way to get started using SPSS and it saves you the hassle of remembering all that code.  But there are some really, really good reasons to use the syntax as well.

1. Efficiency.  If you’re figuring out the best model and have to refine which predictors to include, running the same descriptive statistics on a  bunch of variables, or defining the missing values for all 286 variable in the data set, you’re essentially running the same analysis over and over.

Picking your way through the menus gets old fast.  In syntax, you just copy and paste and change variables names.

2. Memory.  I know that while you’re immersed in your data analysis, you can’t imagine you won’t always remember every step you did.  But you will.  And sooner than you think.  Syntax gives you a “paper” trail of what you did, so you don’t have to remember.

3. Communication.  When your advisor, coauthor, colleague, or statistical consultant asks you which options you used in your analysis or exactly how you recoded that variable, you can clearly communicate it by showing the syntax.  Much harder to explain with menu options.

When I hold a workshop or run an analysis for a client, I always use syntax.  I  send it to them to peruse, tweak, adapt, or admire.  It’s really the only way for me to show them exactly what I did and how to do it.

4. Efficiency again. When the data set gets updated, or a reviewer (or your advisor, coauthor, colleague, or statistical consultant) asks you to add another predictor to a model, it’s a simple matter to rerun a syntax program.  In menus, you have to start all over, and hopefully you’ll remember exactly which options you chose last time (see #2: Memory).

5. Control. There are some options you just can’t do in the menus.  And other that just aren’t what they seem in the menus.  The menus for the Mixed procedure are about the most unintuitive I’ve ever seen.  But it’s really logical in the syntax.  And it’s very much like the GLM syntax, so if you’re familiar with GLM, learning Mixed is a simple extension.

Luckily, SPSS makes it exceedingly easy to create syntax.  If you’re more comfortable with menus, run it in menus the first time, then hit PASTE instead of OK.  SPSS will automatically create the syntax for you, which you can alter at will.  So you don’t have to remember every programming convention.

Bonus Reason: Cleanliness. When refining a model, I run through menus and paste it.  Then I alter the syntax to find the best-fitting model.  At this point, the output is a mess, filled with so many models, I can barely keep them straight.  Once I’ve figured out the model that fits best, I delete the entire output, then rerun the syntax for only the best model.  Nice, clean output.

Want to learn more? If you’re just getting started with data analysis in SPSS, or would like a thorough refresher, please join us in our online workshop Introduction to Data Analysis in SPSS.


Bookmark and Share

Leave a Comment

Please note that, due to the large number of comments submitted, any comments on problems related to a personal study/project will not be answered. We suggest joining Statistically Speaking, where you have access to a private forum and more resources 24/7.

{ 4 trackbacks }

Previous post:

Next post: