Introduction to SPSS

Statistical Package for the Social Sciences.

Other popular statistical tools are: Stata, RStudio, Python…. But SPSS is probably the most user-friendly.

The SPSS Environment

SPSS has 3 main windows:

  • Data Editor: where you see your data matrix (includes “Variable view” and “Data view”).
  • Output Viewer: where you see the result of your commands.
  • Syntax Editor: where you can input your commands without using the drop-down menu.

Note:I will only illustrate how to use the drop-down menus.

However, if you are interested in continuing into more advanced statistics, I encourage you to explore the syntax editor. It is a useful tool to reproduce your analysis later on, even with different datasets.

My suggestion: learn the correct syntax by looking at your output from the drop-down menus.

Import Data

Import SPSS Data: File > Open > Data > Click Ok.

Note: Most of the data we will use in class is already in SPSS format (.sav).

If you need to import other forms of data, click on “Files of type” and choose the format you wish to import:

Importing data in Excel format: File > Open > Data > (“Files of type” = Excel) > Click Ok.

In the window that appears, check the following boxes:

  • Read variable names from first row of data (if you have variable names in excel).
  • Percentage of values that determine data type: 95.
  • Ignore hidden rowns and columns.

Characteristics of variables

In “Variable View” of the “Data Editor”, we have the following information:

  • Name (name of the variable)
  • Type (string or numeric)
  • Width (number of digits)
  • Decimals (number of decimals displayed for numeric variables)
  • Label (explanation about the variable)
  • Values (explanation about the values of that variable)
  • Missing (definition of missing values for that variable)
  • Columns (format of data view)
  • Align (format of data view)
  • Measure (nominal, ordinal, scale)
  • Role (how will you use this variable in your analysis?)

We can manually change the information above in “Variable View” by clicking on the respective cells.

Important: Always create a new variable when modifying variables.

Changing the information above is intuitive. Here are some of the most important modifications:

Variables types

Your variables can have one of the two primary types:

  • String: can contain letters
  • Numeric: only numbers

Important: You want all your variables that will be used in calculations to be numeric variables.

Important: Only variables with text should be string.

How do we know what our variables are?

  • Look at the the variable type under variable view in the data editor
  • In recent versions of SPSS, look for a tiny “a” next to your variable in the data editor - this means the variable is string.

Variable formats

  • String - A10: e.g. text
  • Numeric - F5.2: e.g. 30.52 (2 here is the number of decimals displayed)
  • Numeric - Date: e.g. 25-Jan-2019
  • Numeric - Time8: e.g. 5:36:24

Don’t bother too much about this. It is just for you to know that this exists.

One use of this is to change the number of displaying decimals. E.g. in F5.2, for numeric variables, 5 represent the total number of digits and 2 represents the number of displaying decimails.

Value labels

Set or change value labels: Data Editor > Variable view > Go to the “Values” column > Click on “…” for the variable you are interested in > Manually input the value labels you want > Click “Add” > Click Ok.

Data manipulation

Create new variable

Input new variable: Data Editor > Edit > Insert Variable > Write name and manually populate the column.

You can always create new variables by transforming old variables. We will go over variable transformations later.

Transform string variables into numeric

Automatic recode: Transform > Automatic recode > Bring variable to the variable box > Create variable name and label > Choose from “Lowest value” or “Highest value” > Click Ok.

This second approach gives you more flexibility:

Manual recode: Transform > Recode into different variable > Bring variable to the variable box > Create variable name and label > Old and new values > Choose values > Define variable name > Click Ok.

Important: You need to fill out the “Values column” in the “Variable view” after recoding manually.

Presenting your results

Edit axis properties: Simply edit axis titles by clicking on the default titles in the output window.

Export output as PDF: File > Export > Objects to Export > All visible > Type = (.pdf) > Choose a filename > Click OK.

Note that you can always copy and paste the outputs into a Word document.