SPSS Cheat Sheet

Richard Blissett | Last Updated 2017-11-14


  1. Data Cleaning
  2. Descriptive Statistics
  3. Bivariate Statistics
  4. Regression Methods
  5. Miscellaneous Analysis Tools

The purpose of this review is to simply list common data analysis procedures that we do in quantitative methods research and outline the SPSS point-and-click procedures to accomplish these goals. This document will be updated thoughout time. The commands here are based on SPSS Version 24. I would not recommend starting with this document if you are just beginning with SPSS. Yes, often there are multiple ways to conduct the same analysis. I only present one here for each item.

Data Cleaning

Counting missing data

  1. Analyse \(\rightarrow\) Descriptive Statistics \(\rightarrow\) Frequencies
  2. Select the variable(s)
  3. Click “Continue” and the “OK”

Missing data counts will be at the top of the resulting output.

Edit variable values

  1. Transform \(\rightarrow\) Recode into Same Variables…
  2. Select the variable to transform and move it into the right column.
  3. Click “Old and New Values…”
  4. Under “Old Value”, enter either a specific value you would like to replace or a set of values you would like to replace.
  5. Under “New Value”, enter what the replacement value should be.
  6. Click “Add” under “New Value”.
  7. Click “Continue” and then “OK”.

Create a variable

  1. Transform \(\rightarrow\) Compute Variable…
  2. Click “Type and Label…” to set the variable type, then click “Continue”.
  3. Enter the value for the variable. If it is a string, include the value in quotes.
  4. OR enter a formula for the variable based on the existing variables.
  5. Click “OK”.

Delete a variable

  1. Right-click on the column header
  2. Click “Clear”.

This does not produce a syntax in the Output window. The syntax for deleting a variable is here, in case you are saving your syntax:

  • DELETE VARIABLES [list of variables, separated by spaces].

Drop observations based on some condition (KEEP observations meeting the opposite)

  1. Data \(\rightarrow\) Select Cases… \(\rightarrow\) Select “If condition is satisfied” \(\rightarrow\) If…
  2. Enter the condition based on which observations you would like to keep, then click “Continue”.
  3. Select “Delete unselected cases”.
  4. Click “OK”.

You can specify multiple conditions at the same time by separating them with AND or OR.

Merging datasets

  1. Data \(\rightarrow\) Merge Files \(\rightarrow\) Add Variables…
  2. Note that the datasets you are merging must already be saved as SPSS (.sav) format files. In addition, the variables you are matching on must have the same name across datasets.
  3. Select “An external SPSS statistics data file”, browse for your file, and select it.
  4. Select “Match cases on key variables”, click on the matching variable, and add it to “Key Variables”.
  5. Click “OK”.

Appending datasets

  1. Data \(\rightarrow\) Merge Files \(\rightarrow\) Add Cases…
  2. Note that the datasets you are merging must already be saved as SPSS (.sav) format files. In addition, the variables you are matching on must have the same name across datasets.
  3. Select “An external SPSS statistics data file”, browse for your file, and select it.
  4. All variables already in both datasets will appear in “Variables in New Active Dataset”, and variables not in both datasets will be in “Unpaired Variables”. Move all unpaired variables you want into the right column.
  5. Click “OK”.

Descriptive Statistics

Central tendency: mean, median, and mode (for continuous variable)

  1. Analyze \(\rightarrow\) Descriptive Statistics \(\rightarrow\) Frequencies
  2. Select the continuous variable(s)
  3. Uncheck “Display frequency tables”
  4. Click “Statistics…” and check the desired central tendency measures
  5. Click “Continue” and then “OK”

Central tendency: mode and frequency table (for categorical variable)

  1. Analyze \(\rightarrow\) Descriptive Statistics \(\rightarrow\) Frequencies
  2. Select the categorical variable(s)
  3. Check “Display frequency tables”
  4. Click “Format” and select “Descending counts”
  5. Click “Continue” and then “OK”

The top item in the frequency table is the mode. Note that if multiple categorical variables are selected, a separate frequency table will be created for each variable.

Variability: Standard deviation, variance, and range (for continuous variable)

  1. Analyze \(\rightarrow\) Descriptive Statistics \(\rightarrow\) Descriptives
  2. Select the continuous variable(s)
  3. Click “Options” and select the desired measures of spread
  4. Click “Continue” and then “OK”

Bivariate Statistics

One-Sample T Test

  1. Analyze \(\rightarrow\) Compare Means \(\rightarrow\) One-Sample T Test…
  2. Select the variable
  3. Use the “Options” menu to set the confidence interval level
  4. Set the population mean in “Test Value”
  5. Click “OK”

Two-Sample Independent T Test

  1. Data must be organized such that the continuous variable is one variable and the categorical grouping variable is the other variable.
  2. Analyze \(\rightarrow\) Compare Means \(\rightarrow\) Independent-Samples T Test…
  3. Select the continuous variable and move it to “Test Variable(s)” selection
  4. Select the categorical outcome and move it to the “Grouping Variable” selection
  5. Click “Define Groups…”
  6. Enter the two values for the two groups that will be compared (e.g., 1 and 0, or “Male” and “Female”)
  7. Click “Continue” and then “OK”

Two-Sample Dependent T Test

  1. Data must be organized such that the continuous variable is in two separate variables, one for each time period/half of the paired sample.
  2. Analyze \(\rightarrow\) Compare Means \(\rightarrow\) Paired-Samples T Test…
  3. Select the two continuous variables and move them over to the right side – they should be under “Pair 1”
  4. Click “OK”

Correlation

  1. Analyze \(\rightarrow\) Correlate \(\rightarrow\) Bivariate
  2. Select all variables that you wish to correlate
  3. Click “OK”

Regression Methods

Ordinary least squares regression

    1. Analyze \(\rightarrow\) Regression \(\rightarrow\) Linear
    2. Move your dependent variable into the spot for “Dependent”
    3. Move your independent variable(s) into the spot for “Block 1 of 1”
    4. Click “OK”

Miscellaneous Analysis Tools

Specify the “working” dataset

Logic: When using point-and-click, SPSS will only be able to refer to one dataset as a time, even though it is possible to have multiple datasets open at a time.

You can specify which dataset you are working from using the following syntax:

  • DATASET ACTIVATE [dataset name]

You can figure out the name of the dataset by finding the syntax line the opened the dataset in your output window (starts with GET FILE) and look for where it says DATASET NAME.

Conduct analysis for subset of observations

Logic: Rather than attaching the condition to the specific command as is the case in other languages (“Do X if Y”), SPSS workflow requires you to “filter” your data, which temporarily allows you to run commands on a subset of the data. When you are done, you can restore the full set of data.

  1. Data \(\rightarrow\) Select Cases… \(\rightarrow\) Select “If condition is satisfied” \(\rightarrow\) If…
  2. Enter the condition based on which observations you would like to keep, then click “Continue”.
  3. Select “Filter out unselected cases”.
  4. Click “OK”.

When you are done with doing an analysis on your filtered subset, you can restore the full set of data using the following syntax.

  • USE ALL.