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

SPSS Keyboard Shortcuts

SPSS keyboard shortcuts allow you to work with amazing speed. Some of the best SPSS shortkeys are not obvious at all so we'll list our 20 favorite SPSS shortkeys in the table below.Note: some shortkeys may be different on a Macintosh.

Enjoy!

Overview Most Useful SPSS Shortkeys

WhereShortkeyUseful for
Data EditorCTRL + tSwitch between data view and variable view.
Data EditorCTRL + keyboard arrow / keyboard arrowGo to first/last variable/case (depending on view). Allows for very quick case and variable count when combined with CTRL + t.
Syntax WindowShift + keyboard arrow / keyboard arrowSelect lines of syntax above/below cursor position.
Syntax WindowF2Select Entire Command in which cursor is located.
Syntax WindowCTRL + rRun selected syntax.
Any WindowCTRL + Home / EndGo to beginning/end of window contents.
Syntax WindowCTRL + cCopy selected syntax.
Syntax WindowCTRL + xCut selected syntax.
Syntax WindowCTRL + vPaste selected syntax.
Syntax WindowCTRL + aSelect all syntax in window.
Syntax WindowCTRL + fFind expression within syntax window.
Syntax WindowCTRL + hReplace expression within syntax window.
Syntax WindowCTRL + zUndo last edit(s). Note: doesn't always seem to work properly in recent SPSS versions.
Syntax WindowHome / EndMove to start/end of line.
Any WindowAlt + tabSwitch between Syntax Window, Data Editor and Viewer Windows. Actually an MS Windows shortkey for switching between applications.
Any WindowAlt + F4Close any window. You'll usually get a pop-up window asking whether you'd like to save it if you haven't done so yet.
Syntax WindowF1When your cursor is located anywhere in a command, help for this command can be opened by pressing F1.
Syntax WindowShift + Home / EndSelect from cursor through start/end of line.
Any WindowCTRL + Shift + Home / EndSelect from cursor through beginning/end of window contents.
Syntax WindowCTRL + yRedo last edit(s).
Any WindowAlt + F6Back to previous window. Handy for switching between Syntax Window and Data Editor.

SPSS Command Types

Summary

SPSS commands come in three basic types: procedures, transformations and other commands. Understanding this distinction will allow you to get things done in SPSS faster and more efficiently.

SPSS Command Types Diagram

SPSS Command Types

SPSS Transformations

As shown in the figure, the first question is when a command is executed. Some SPSS commands are not carried out immediately when you run them. Such commands are referred to as transformations.
Most transformations create or “transform” data values. Typical examples are COMPUTE and IF. As a rule of thumb, only transformations can be used with LOOP, DO IF and DO REPEAT. For a more detailed discussion, see SPSS Transformation Commands.

SPSS Procedures

For commands that are executed immediately, the second question is whether they read the data. In SPSS, “reading the data” refers to the process of SPSS going through all cases (from top to bottom) in the data. This is explained and illustrated under data pass.
All commands that read the data are referred to as procedures in SPSS. Procedures do two basic things: report on data values (DESCRIPTIVES, FREQUENCIES) or create/tranform data values (AGGREGATE, RANK).
A reason for distinguishing procedures from other commands is that they do more than just their core functions. For instance, they also cause transformations to be executed and some other things. Second, procedures may require a lot of time when run on large datasets. For a more detailed discussion, see SPSS Procedures.

Other SPSS Commands

SPSS Command Types

As shown in the figure, 5 groups of SPSS commands that are neither procedures nor transformations can be distinguished. These commands perform all sorts of tasks except report on data values or create/edit data values. We'll briefly discuss these 5 groups in the remainder of this tutorial.

SPSS Dictionary Commands

SPSS data files consist of two main components. First, there's data values as can be seen in data view. Second, there's dictionary information, part of which can be seen in variable view. SPSS’ dictionary contains mostly information describing data files and their variables and values.
Some dictionary information being incorrect or absent (especially missing values, variable labels and value labels) can cause corrupted data and erroneous research conclusions. It's therefore recommended that you carefully manage your data’s dictionary. The table below lists some commands for doing so. These commands can't be pasted from the menu but, fortunately, they're utterly simple.
Do not edit dictionary information manually under variable view. Because you can't keep track of such modifications (let alone replicate or correct them), you may have to do things all over if anything goes wrong.

Overview Main SPSS Dictionary Commands

Command NameBasic Function
ADD VALUE LABELSAdd or edit value labels.
MISSING VALUESSpecify missing values for one or many variables.
VALUE LABELSErase all value labels from one or more variables and/or specify new ones. For editing value labels, ADD VALUE LABELS is usually a better option.
RENAME VARIABLESChange variable names.
VARIABLE LABELSAdd or edit description of variables.
FORMATSSet formats for (mostly) numeric variables.
VARIABLE LEVELSets measurement levels for variables.
VARIABLE WIDTHSet display width (columns in variable view) for variable(s).
DELETE VARIABLESPermanently delete one or more variables.
STRINGCreate new string variable before setting its values with COMPUTE, IF or other command.
DOCUMENTA DOCUMENT is a data file description that is saved as part of the dictionary.
DROP DOCUMENTSSee DOCUMENT.
APPLY DICTIONARYCopy dictionary properties between files or variables.
DISPLAYDisplay parts of dictionary. Use SHOW for displaying settings.
SYSFILE INFODisplay dictionary information from external SPSS data file.

SPSS Windows Commands

Starting from SPSS version 14, you can have multiple Data Editor windows open simultaneously. These are referred to as datasets. For controlling these windows, use DATASET commands, some of which are listed in the table below.
From SPSS version 15, multiple output viewer windows can be used at once as well. These can be controlled by the OUTPUT commands in the table below.
Finally, you can also use multiple Syntax Editor windows simultaneously. Oddly, commands such as SYNTAX SAVE are as yet non existent in SPSS.
Note that OUTPUT MODIFY, introduced in SPSS version 22, is entirely different from the other OUTPUT commands: it does not control output windows but modifies items (mostly tables) in the active output window.

Overview Main SPSS Windows Commands

Command NameBasic Function
DATASET NAMEAssign name to dataset by which it can be addressed. Allows working on multiple datasets simultaneously.
DATASET ACTIVATEChoose which dataset is addressed by subsequent commands.
DATASET CLOSEClose dataset (without saving).
OUTPUT NAMEAssign name to output window by which it can be addressed. Allows using multiple output windows simultaneously.
OUTPUT ACTIVATEChoose output window to which subsequent output should be appended.
OUTPUT CLOSEClose output window (without saving).

SPSS Sytem Settings

SPSS system settings control a myriad of (sometimes technical) SPSS settings. These settings hold for all open SPSS windows.

Overview Main SPSS System Settings

Command NameBasic Function
SETEdit one or more settings except CD. Use SHOW for displaying settings.
SHOWShow one or more settings. Use SET for editing settings. Use DISPLAY for showing dictionary information.
CDSet default directory. Affects all commands (including GET, SAVE, INSERT and SET CTEMPLATE) except SET TLOOK.
PRESERVERemember current settings. Enables to RESTORE them later.
RESTOREUsed with PRESERVE.

SPSS Data Settings

Some settings are applied only to the active dataset, which distinguishes them from SPSS system settings. They are listed in the table below.

Overview SPSS Data Settings

Command NameBasic Function
FILTERExclude selection of cases from procedures.
SPLIT FILEHave procedures process groups of cases separately.
WEIGHTAssign weights to cases.

Other SPSS Commands

Finally, some SPSS commands don't fit into any of the aforementioned groups. These include some very useful ones such as INSERT, VECTOR and OMS. The table below lists some of them.

Overview Main Other SPSS Commands

Command NameBasic Function
INSERTRun external syntax file. Successor of (now deprecated) INCLUDE.
INCLUDERun external syntax file. Deprecated as predecessor of INSERT.
VECTORAllow variables to be addressed by index. Mainly used with LOOP.
OMSStart monitoring, capturing or suppressing selected output.
OMSENDStop monitoring/capturing/suppressing selected output and show/save captured output if any.
DEFINE-!ENDDEFINEDefine macro. Mostly deprecated since Python was introduced in SPSS version 14.
SCRIPTDeprecated since Python was introduced in SPSS version 14.
PERMISSIONSSet file permissions (read-only).
ERASEDelete one or more external files. Use carefully.
OUTPUT MODIFYModifies output items such as tables.

Compute A = B = C

Summary

A great way to dichotomize variables is with a single short compute command. This is also the fastest way to create multi variable filters.

How Does it Work?

When the structure COMPUTE A = B = C is used, SPSS will evaluate whether (B = C) is True or False for each case. The outcome variable A will be the following

A nice extra here is that the outcome variable A is perfect for using with FILTER.

Multiple Conditions

More complex conditions can be used in a similar vein, such as COMPUTE FLAG = V1 GT V2 AND V3 = 5.. This would mean the following:

SPSS Syntax Examples

*1. Create test data.

data list free/v1 v2.
begin data
1 6 '' 5 3 4 4 3 5 2 6 1
end data.

*2. Flag cases where v1 is greater than (gt) 2.

compute flag.1 = v1 gt 2.

*3. Flag cases where both v1 and v2 gt 2.

compute flag.2 = v1 gt 2 and v2 gt 2.
exe.