SPSS tutorials website header logo SPSS TUTORIALS VIDEO COURSE BASICS ANOVA REGRESSION FACTOR

SPSS TEMPORARY Command

Summary

In SPSS, TEMPORARY indicates that the commands that follow are temporary. Temporary commands will be undone (reversed) when a command is run that reads the data. Such a command also indicates that the commands that follow are not temporary anymore.

SPSS Temporary CommandTemporary commands between TEMPORARY and a command that reads the data.

SPSS Temporary Example

“We'd like to dichotomize customer satisfaction into "satisfied" and "not satisfied". Next, we'd like to see its relation to perceived quality. For each category of the latter, we want to see the percentage of satisfied customers.”

We'll first create and label our dichotomous variable. Next, we'll modify its format a bit but only for the requested table. By using TEMPORARY we don't need to undo these modifications after creating the table. The syntax below demonstrates this. It uses supermarket.sav.

SPSS Temporary Syntax Example

*1. Dichotomize v1 into "satisfied".

compute satisfied = v1 ge 4.

*2. Apply clear labels to our new variable.

variable labels satisfied "Dichotomized version of v1".

value labels satisfied 0 "Not satisfied" 1 "Satisfied".

*3. Start temporary commands.

temporary.

*4. Temporary commands for showing percentages in table.

compute satisfied = 100 * satisfied.

formats satisfied(pct3.0).

variable labels satisfied "Percentage of satisfied customers".

*5. Creating table reads data and reverses temporary commands.

means satisfied by v5 /cells mean.

*6. Temporary commands have been undone now.

means satisfied by v5 /cells mean.

Note that the second MEANS command is identical to the first one. Its output is different because the temporary modifications that affect the first table have been undone by the first MEANS command.

SPSS Temporary Command ResultSame command, different results

Which Commands Read the Data?

In order to use TEMPORARY effectively, you must know which commands do or do not read the data.What reading the data means in the first place is discussed in SPSS Procedures.An easy option for finding this out is consulting the command syntax reference. Where relevant, it explicitly states whether a command reads the data. When in doubt, experienced users can probably just reason out whether a command reads the data or not.

Which Commands are Affected by Temporary?

As a rule of thumb

can be used with TEMPORARY. For a complete and more accurate overview, consult the CSR.

SPSS TableLooks – Quick Introduction

SPSS TableLooks are files that contain styling
-colors, fonts, borders and more- for SPSS output tables.

SPSS Tablelook Example Output Table Styled by TableLook Example

Practice Data File

This tutorial uses bank_clean.sav throughout. Part of its data view is shown below. Feel free to download these data and try the examples we'll run for yourself.

SPSS Bank Sav Data View

What are TableLooks?

SPSS TableLooks are tiny text files written in XML. They contain styling for output tables such as

TableLooks have the .stt file extension (.stt is short for SPSS table template, the old name for TableLooks). SPSS ships with some TableLooks which you find in the Looks subfolder as shown below.

SPSS TableLooks in Looks Subfolder

Ironically, some of these TableLooks don't work because they contain errors. But we'll get to that later.

Some things TableLooks can't do are

For these modifications, try OUTPUT MODIFY instead.

Applying TableLooks

Let's first create a very simple means table. The fastest way to do so is running the following line of syntax: means salary by jtype. If you're on SPSS version 23 or higher, the resulting table looks awful.

SPSS Table Without Tablelook Default Table Styling for SPSS 23 and Higher

However, if we set a different TableLook and rerun the table, it'll look way better. The syntax below does just that. Note that you probably need to change the path to your Looks folder.

Set TableLook and Rerun Means Table

*Set APA table template for all following tables. Note: you may need to change the path.

set tlook 'C:\Program Files\IBM\SPSS\Statistics\24\Looks\APA_TimesRoma_12pt.stt'.

*Rerun basic means table.

means salary by jtype.

Result

SPSS Apa Tablelook Not Correct

This already looks much better, doesn't it? However, the text alignment is somewhat awkward and does not follow APA guidelines. Can't we do better? Yes we can.

Creating TableLooks

Let's double-click this last table and open the Format menu as shown below. If it looks different, make sure you double-click the table. We'll briefly discuss its main options below.

SPSS Table Editor Format Menu

Set properties for a selection of table cells here. However, these changes can't be saved as a TableLook (.stt) file.
Set properties for table areas -titles, headers, data cells- here. These changes can be saved as a TableLook.
After editing some table, save its styling as a TableLook here.

Since we'd like to make changes that we can save as a TableLook, we choose Table Properties. We can now set styles for different table areas as shown below.

SPSS Edit Tablelook

When we're done, we'll double-click our table again and select TableLooks. We can now save the styling we just applied as a new or existing TableLook (.stt) file.

SPSS Save Tablelook Dialog

We can now activate our TableLook by running something like set tlook 'd:/data/myNewTableLook.stt'. From now on, all tables we'll create will look great! Like the one shown below, for example.

SPSS Tablelook Example Output Table Styled by TableLook Example

If you want to revert to the ugly SPSS defaults, you can do so by running set tlook none.

Developing TableLooks

If you're not afraid of code, there's a faster way to develop TableLooks: you can edit their XML directly in some text editor such as Notepad++. The screenshot below shows what that looks like.

SPSS Tablelook Xml In Notepad

Issues with TableLooks

As we already mentioned, some TableLooks developed by IBM SPSS don't work in recent SPSS versions. For an example, try and run the syntax below.

*Use Tablelook from IBM SPSS.

set tlook 'C:\Program Files\IBM\SPSS\Statistics\25\Looks\LargeFont.stt'.

*Running table triggers warning and ugly default styling is used.

frequencies jtype.

Result

SPSS Tablelook Bug

So when we activate this TableLook, everything seems fine. However, as soon as we actually run some table, we get the following warning: File C:\Program Files\IBM\SPSS\Statistics\25\Looks\LargeFont.stt specified for SET TLook is not a valid SPSS Statistics file. This warning comes up whenever a TableLook file contains errors. Which is somewhat ironic for a TableLook that ships with SPSS.

A second issue with SET TLOOK is that it ignores the CD setting. I always deliver entire projects -all data, syntax, output and templates- to my clients. This allows them to replicate exactly everything I did. I really feel that this should be the standard for any professional.
Right, so my clients usually download the project folder holding all necessary files. Next, they only need to change the CD setting and

for no apparent reason. It would be nice if this annoying issue would be fixed rather than just mentioned in the documentation.

Right, I guess that'll do for a quick introduction to SPSS TableLooks. Hope you found it helpful.

Thanks for reading!