• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
The Analysis Factor

The Analysis Factor

Statistical Consulting, Resources, and Statistics Workshops for Researchers

  • Home
  • Our Programs
    • Membership
    • Online Workshops
    • Free Webinars
    • Consulting Services
  • About
    • Our Team
    • Our Core Values
    • Our Privacy Policy
    • Employment
    • Collaborate with Us
  • Statistical Resources
  • Contact
  • Blog
  • Login

How to Effortlessly Create SPSS Syntax and Automatically Add it to your Output

by Karen Grace-Martin 4 Comments

So hopefully I’ve extolled the benefits of using SPSS Syntax enough that you’re convinced it is something you should regularly use.

Even if you don’t start programming, there are two things you can do to begin learning Syntax and give you the communication and tracking benefits.

1. From now on, when you use menus for an analysis, instead of clicking the “OK” button, click “Paste.”*

When you use the menus and click OK, SPSS is translating your menu choices into syntax.  You just don’t see it.

When you click Paste, though, SPSS opens a syntax window and writes a copy of this syntax.  To run it, simply go to the Syntax window, highlight the procedure you want to run, and click the Run button, which looks like a triangle facing right.

This will get you used to the kind of language SPSS Syntax uses. You can, if you wish, start to edit it.

But even if you don’t, over time you’ll start to notice how logical it is and how the menu choices correspond to phrases in the syntax. And you’ll at least have a record of what you did.

*Alas, the student version of SPSS does not have any syntax capabilities.  This is sad, because I think it’s beneficial to begin using syntax right away.

2. Set up the options to put the syntax in your output as well.

I’ve been using SPSS Syntax, on and off, since 1991.  (And yes, that makes me feel old).  But it was only a few years ago that I realized there is an option to paste a copy of your syntax for each procedure into the Output.  It goes into a Log, which is a text entry right above each procedure.

For the purposes of remembering yourself and communicating to coauthors exactly how you did your analysis (let’s see…did I choose promax or oblimin rotation?), this is the BOMB.  This is more important that running a separate syntax file.  If you are running a lot of analyses and are not impeccably organized about which output goes with which syntax program file, that syntax file isn’t going to help you remember what you did.  It will help you rerun everything quickly to figure out which program gave you that output, but what could be better than having the program, with all the options you chose, right on the output?

Just the other day, after I wrote the post on the importance of using SPSS Syntax to keep track of what the heck you’re doing, a client emailed me with a question about the results of an analysis we’d run in April.  We had run quite a few models to figure out the best-fitting one, and 6 months later, I couldn’t remember which was the final one, so I asked her to send me the final output.

Well, despite the fact that we’d run all the analyses in syntax, she didn’t have this option turned on, so the syntax wasn’t on the output.  It was a head-slapping kind of moment.  (My own, of course).  So I encourage you to turn it on and keep it that way.

It seems that the folks at SPSS also figured out how useful it is, so as of version 15 or 16, it seems to default to this.  At least it did when I installed 16.  But it’s an easy option to change in earlier versions as well.

Go to Edit–>Options, then click on the Viewer tab.  Somewhere in there–it looks a little different in every version–is a little box labeled “Display Commands in Log.”  Click it, and you’re done!

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

Tagged With: spss syntax

Related Posts

  • Member Training: Introduction to SPSS Software Tutorial
  • SPSS Syntax 101
  • Why report estimated marginal means?
  • The Joy of Pasting SPSS Syntax

Reader Interactions

Comments

  1. James olvier says

    September 17, 2021 at 7:14 am

    Hey There,
    I read your blog about SPSS syntax, I think that is the right and relatable thing with SPSS tools. And that blog is also helpful for students who want to perform their data analysis.

    Reply
  2. Mark says

    February 6, 2013 at 9:12 am

    Many thanks for your blog – very useful.

    Reply
  3. Jeromy Anglim says

    November 11, 2009 at 5:00 am

    I agree. If you are using SPSS, syntax is important for many reasons, not least of which is trying to make your research more reproducible.

    I have a couple of posts on my blog, which might interests readers of this post.

    How to use syntax effectively:
    http://jeromyanglim.blogspot.com/2009/10/introduction-to-spss-syntax-advice-for.html

    How to use syntax to make variable selection more efficient:
    http://jeromyanglim.blogspot.com/2009/10/syntax-tips-for-efficient-variable.html

    Reply
    • Karen says

      November 11, 2009 at 5:18 pm

      Hi Jeromy,

      Thanks, I looked at your posts, and I agree, they look very helpful!

      Karen

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Please note that, due to the large number of comments submitted, any questions 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.

Primary Sidebar

This Month’s Statistically Speaking Live Training

  • Member Training: Introduction to SPSS Software Tutorial

Upcoming Free Webinars

Poisson and Negative Binomial Regression Models for Count Data

Upcoming Workshops

  • Analyzing Count Data: Poisson, Negative Binomial, and Other Essential Models (Jul 2022)
  • Introduction to Generalized Linear Mixed Models (Jul 2022)

Copyright © 2008–2022 The Analysis Factor, LLC. All rights reserved.
877-272-8096   Contact Us

The Analysis Factor uses cookies to ensure that we give you the best experience of our website. If you continue we assume that you consent to receive cookies on all websites from The Analysis Factor.
Continue Privacy Policy
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT