Learning just a handful of SPSS system settings allows you to get better results faster. This tutorial quickly walks you through the five most useful ones. We recommend you follow along with the examples by downloading and opening employees.sav.
SPSS SET TNUMBERSSPSS TNUMBERS determine how data values are displayed.
In SPSS, tnumbers (short for “table numbers”) refer to how values are displayed in pivot tables: 1) as values, 2) as value labels or 3) as both. The syntax below demonstrates these three options.
Setting tnumbers is mainly relevant for the FREQUENCIES, CROSSTABS and MEANS commands. Unlabelled values in your data are always shown as values, regardless of this setting.
SPSS SET TNUMBERS Syntax Example
set tnumbers values.
*2. Show only value labels in tables (reporting).
set tnumbers labels.
*3. Show values and value labels in tables (data exploration and editing).
set tnumbers both.
SPSS SET TVARSSPSS TVARS determine how variables are displayed in pivot tables.
In SPSS, tvars (short for “table variables”) determines how variables are shown in pivot tables: 1) as variable names, 2) as variable labels or 3) both. The syntax below demonstrates these options.
Setting tvars is mostly important for DESCRIPTIVES, CORRELATIONS and many other commands. Whatever the setting, unlabelled variables are always shown as names.
SPSS SET TVARS Syntax Example
set tvars names.
*2. Show only variable labels (reporting).
set tvars labels.
*3. Show variable names and labels (data exploration and editing).
set tvars both.
SPSS SET CTEMPLATE
Now let's say we'd like to see a histogram of the years that our respondents have been working for this company. The simplest way for generating it is running frequencies years/format notable/histogram. The default result is shown below.
If you feel this chart looks good, feel free to continue reading at PRINTBACK. If you'd like a prettier chart, the way to go is setting a ctemplate, short for SPSS chart template. For a histogram, you can download (and save) one here.
A solid way for using it is copying the file to your project folder and setting the latter as your default directory. Now you can easily apply it by running
set ctemplate ... as shown in the syntax below.
SPSS SET CTEMPLATE Syntax Example
*2. Set chart template. Make sure file is located in default directory.
set ctemplate 'histogram-standard-styled-ftitle-720-1.sgt'.
*3. Run histogram.
frequencies years/format notable/histogram.
*4. Switch off chart template for subsequent charts.
set ctemplate none.
SPSS SET PRINTBACK
Setting printback on results in SPSS printing all syntax you run to your output window. If you run commands directly from the menu (which we don't recommend), then the underlying syntax is also printed back. As a first example, let's try the syntax below.
SPSS SET PRINTBACK Syntax Example
set printback on.
*2. Note how command below appears in output window upon running it.
A shortcoming of SPSS is that the syntax it generates is often way more complicated than necessary. This interferes with learning syntax. For a dreadful example, let's change one setting by using the menu: we'll navigate to. Next, follow the screenshot below.
As we see, SPSS just printed an awful lot of syntax to our output window. However, what we just did in the menu corresponds to running simply set tnumbers labels. Although this is present in the syntax that SPSS just generated, the rest of it does nothing whatsoever. This is not helpful at all for learning how to get things done fast. We stop printing our syntax to the output window by running set printback off.
SPSS SET TLOOK
The last SPSS system setting we'd like to discuss relates to SPSS table templates. Let's generate a basic descriptives table by running
We find this table not very pretty. For a nicer looking table, you can download (and save) a table template here and copy it into your project folder. You can now activate it by runing
set tlook ... as shown below. Due to a (suspected) bug, SPSS ignores your default directory in this case so you need to use the full path here.
SPSS SET TLOOK Syntax Example
set tlook 'd:/project_01/desc-styled-notitle-720-1.stt'.
*2. Run table.
*3. Switch off table template for subsequent output.
set tlook none.
SPSS SHOW Command
Last but not least, you can view all of your system settings (and more) by using SPSS’ SHOW command. So after running set ctemplate 'histogram-standard.sgt'. you can confirm that this chart template is in effect by running show ctemplate. Finally, readers who really, really want to know all system settings (many of which you'll probably never use) may run show all.