SPSS tutorials

BASICS REGRESSION T-TEST ANOVA CORRELATION

SPSS – Five Handy System Settings

Summary

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 TNUMBERS

SPSS SET TNUMBERS ExamplesSPSS 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

*1. Show only values in tables (rarely used).

set tnumbers values.

frequencies edu.

*2. Show only value labels in tables (reporting).

set tnumbers labels.

frequencies edu.

*3. Show values and value labels in tables (data exploration and editing).

set tnumbers both.

frequencies edu.

SPSS SET TVARS

SPSS SET TVARS ExamplesSPSS 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

*1. Show only variable names (rarely used).

set tvars names.

descriptives years.

*2. Show only variable labels (reporting).

set tvars labels.

descriptives years.

*3. Show variable names and labels (data exploration and editing).

set tvars both.

descriptives years.

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.

SPSS Histogram Standard

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

*1. Set default directory.

cd 'd:/project_01'.

*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.

Result

SPSS Histogram Chart Template

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

*1. Print all subsequent syntax to output window.

set printback on.

*2. Note how command below appears in output window upon running it.

descriptives years.

Verbose Syntax

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 Edit SPSS Menu Arrow Options SPSS Menu Arrow Output. Next, follow the screenshot below.

SPSS SET TNUMBERS from menu

Result

SPSS Verbose Syntax from Menu Example

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 descriptives years. SPSS Descriptives Table Standard 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

*1. Set table template and include folder where file is located in path.

set tlook 'd:/project_01/desc-styled-notitle-720-1.stt'.

*2. Run table.

descriptives years.

*3. Switch off table template for subsequent output.

set tlook none.

Result

SPSS Descriptives Table with Table Template

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.

Previous tutorial: SPSS OUTPUT MODIFY – Batch Edit Output Items

Next tutorial: SPSS Datasets Tutorial 1 – Basics

Let me know what you think!

*Required field. Your comment will show up after approval from a moderator.

This tutorial has 1 comment!