SPSS tutorials website header logo SPSS TUTORIALS BASICS ANOVA REGRESSION FACTOR CORRELATION

SPSS SET – Quick Tutorial

Why should you learn anything about your SPSS settings? Well, doing so allows you to

So which settings are interesting to learn about? The table below presents our top 10.

Top 10 Most Useful SPSS Settings

SETTINGOPTIONSDESCRIPTION
TNUMBERSBOTH / LABELS / VALUESHow to show values in pivot tables
TVARSBOTH / LABELS / NAMESHow to show variables in pivot tables
OVARSBOTH / LABELS / NAMESHow to show variables in output viewer outline
TLOOK(path to .stt file) / NONETablelook file: styling for pivot tables
SIGLESSON / OFFWhether to display small significance levels as < 0.001 in tables
CTEMPLATE(path to .sgt file) / NONEChart template file: styling for charts
LOCALE(locale) / OSLOCALECountry and character set
SEED(chosen integer) / RANDOMRandom seed used if RNG = MC
PRINTBACKNONE / LISTINGWhether to print syntax to output viewer
ODISPLAYMODELVIEWER / TABLESWhether to use model viewer for some output

Background & Googlesheet for All Settings

The vast majority of settings can be adjusted by navigating to Edit SPSS Menu Arrow Options as shown below.

SPSS Edit Options

Sadly, the options dialog is a bit of a labyrinth and finding your way here can be time consuming. Another major stupidity is that there's no Paste button here either.

SPSS Options Dialog

For these reasons, using SPSS syntax is a much better option for adjusting your settings. But where to start? Well, first off, we created an overview of all settings in this Googlesheet, partly shown below.

SPSS Overview All Settings In Googlesheets

Note that Column F suggests if we think some setting is useful. The remainder of this tutorial demonstrates the 10 most useful settings, ordered from most to least important. All examples use bank-clean.sav, partly shown below.

SPSS Bank Clean Variable View

SET TNUMBERS - Table Numbers

TNUMBERS controls how values are shown in output tables. The syntax below presents a quick demo.

*Show values and value labels in all succeeding tables.
set tnumbers both.

*Run minimal frequency table.
frequencies marit.

*Show only value labels in all succeeding tables.
set tnumbers labels.

*Run minimal frequency table.
frequencies marit.

Result

SPSS Set Tnumbers Example

Reporting values and value labels is the recommended setting for screening data. However, for creating “clean” tables to include in your final report, you probably want to show only value labels.

SET TVARS - Table Variables

TVARS controls how variables are shown in output tables. For a quick demo, try the syntax below.

*Show variable names and labels in succeeding output tables.
set tvars both.

*Run minimal descriptives table.
descriptives q1 to q3.

*Show only variable labels in succeeding output tables.
set tvars labels.

*Run minimal descriptives table.
descriptives q1 to q3.

Result

SPSS Set Tvars Example

For screening data, showing both variable names and labels is often the way to go. For creating reporting tables, however, we recommend showing only variable labels.

SET OVARS - Outline Variables

OVARS controls how variables are shown in the output outline. The syntax below gives a quick demo.

*Show variable names and labels in viewer outline.
set ovars both.

*Frequency tables & barcharts.
frequencies q1 to q3
/barchart.

*Show only variable names in viewer outline.
set ovars names.

*Frequency tables & barcharts.
frequencies q1 to q3
/barchart.

Result

SPSS Set Ovars Example

Note that the OVARS setting ignores the bar charts created with the frequency tables. The same goes for histograms. We believe this to be a tiny -but sometimes annoying- bug in SPSS.

SET TLOOK - Tablelook

Tablelooks or .stt files are plain text files containing styling for tables such as fonts, background colors and borders. The syntax demo below requires that clean-11pt.stt is located in a folder d:/templates on your computer.

*Use SPSS default table styling.
set tlook none.

*Run minimal frequency table.
frequencies marit.

*Set nicer tablelook.
set tlook 'd:/templates/clean-11pt.stt'.

*Run minimal frequency table.
frequencies marit.

Result

SPSS Set Tlook Example

Notes

SET SIGLESS - Significance Less Than...

SIGLESS (introduced in SPSS 27) controls how small significance levels are shown in output tables. We believe there's a bug regarding this setting: the syntax below ignores it unless you run each line separately.

*Show small p-values as <.001.
set sigless on.

*Run minimal correlation matrix.
correlations dob salary.

*Show small p-values as .000.
set sigless off.

*Run minimal correlation matrix.
correlations dob salary.

Result

SPSS Set Sigless Example

SET CTEMPLATE - Chart Template

Chart templates or .sgt files are plain text files containing styling for charts such as colors, sizes and layout. The quick demo below requires that barchart-freq-dsort-en-h360.sgt is located in a folder d:/templates on your computer.

*Use SPSS default styling for charts.
set ctemplate none.

*Minimal bar chart frequencies.
GRAPH
/BAR(SIMPLE)=COUNT BY marit
/TITLE='Frequency Distribution Marital Status'
/SUBTITLE='All Respondents | N = 464'.

*Set chart template for bar charts.
set ctemplate 'd:/templates/barchart-freq-dsort-en-h360.sgt'.

*Minimal bar chart frequencies.
GRAPH
/BAR(SIMPLE)=COUNT BY marit
/TITLE='Frequency Distribution Marital Status'
/SUBTITLE='All Respondents | N = 464'.

Result

SPSS Set Ctemplate Example

Notes

SET LOCALE

In recent SPSS versions, LOCALE is mainly used for specifying which decimal separator to use. It may also affect which character encoding SPSS uses but only if UNICODE = OFF (rarely used anymore).

*Set locale to German (comma as decimal separator).
set locale 'german'.

*Run minimal descriptives table.
descriptives whours.

*Set locale to German (dot as decimal separator).
set locale 'english'.

*Run minimal descriptives table.
descriptives whours.

Result

SPSS Set Locale Example

Quick note: I often prefer to use the DOT and COMMA formats for choosing which decimal separator is used. Doing so also makes converting string to numeric variables independent of your settings as discussed in SPSS Convert String to Numeric Variable. The syntax below, however, simply replicates the previous example using this alternative method.

*Set format whours to dot (comma as decimal separator).
formats whours(dot2).

*Run minimal descriptives table.
descriptives whours.

*Set format whours to comma (dot as decimal separator).
formats whours (comma2).

*Run minimal descriptives table.
descriptives whours.

SET SEED - Random Seed

Setting a random seed allows you to exactly replicate anything random in SPSS: computing random variables or drawing random samples. The example below computes two normally distributed random variables and then exactly replicates both.

*Set random seed to 1 (assuming RNG = MC).
set seed 1.

*Compute two "random" variables.
compute rnd01 = rv.normal(100,15).
compute rnd02 = rv.normal(100,15).
execute.

*Reset random seed to 1 (assuming RNG = MC).
set seed 1.

*Replicate previous "random" variables.
compute rnd03 = rv.normal(100,15).
compute rnd04 = rv.normal(100,15).
execute.

Result

SPSS Set Seed Example

Minor note: SET SEED only takes effect if RNG = MC (default). You need to use SET MTINDEX if RNG = MT but I don't think anybody ever uses that.

SET PRINTBACK

PRINTBACK tells SPSS whether to print the syntax you run (either from a syntax window or the menu) into your output window. Doing so may come in handy if you export all output to a single .pdf or WORD file.

*Print syntax into output viewer.
set printback listing.

*Run minimal descriptives table.
descriptives whours.

*Don't print syntax into output viewer.
set printback none.

*Run minimal descriptives table.
descriptives whours.

Result

SPSS Set Printback Example

SET ODISPLAY - Output Display

For GENLINMIXED and NPTESTS, two output formats are available:

The syntax below creates both formats for a basic Kruskal-Wallis test.

*Create model viewer for NPTESTS (not recommended).
set odisplay modelviewer.

*Kruskal-Wallis test.
NPTESTS
/INDEPENDENT TEST (salary) GROUP (jtype) KRUSKAL_WALLIS(COMPARE=PAIRWISE)
/MISSING SCOPE=ANALYSIS USERMISSING=EXCLUDE
/CRITERIA ALPHA=0.05 CILEVEL=95.

*Create pivot tables for NPTESTS (recommended).
set odisplay tables.

*Kruskal-Wallis test.
NPTESTS
/INDEPENDENT TEST (salary) GROUP (jtype) KRUSKAL_WALLIS(COMPARE=PAIRWISE)
/MISSING SCOPE=ANALYSIS USERMISSING=EXCLUDE
/CRITERIA ALPHA=0.05 CILEVEL=95.

Result

SPSS Set Odisplay Example

Note: I usually prefer a completely different command for the Kruskal-Wallis test as discussed in How to Run a Kruskal-Wallis Test in SPSS? This method does not include pairwise comparisons but I'm not a big fan of those anyway.

Related Commands - SHOW, PRESERVE & RESTORE

Before closing off, I should point out that you can use SHOW for looking up settings. Like so, SHOW ALL. shows all settings. These include some that you can't set with SET and some that you can't change at all.

Last but not least, you can undo changes in settings by preceding SET with PRESERVE and succeeding it with RESTORE. I find these commands mostly useful for building SPSS tools that change somebody else’s settings.

Right, I hope you found this tutorial helpful. Let me know if you (dis)agree and/or if I missed anything by throwing a quick comment below. Other than that:

Thanks for reading!

Tell us what you think!

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

THIS TUTORIAL HAS 5 COMMENTS: