Skip to Main Content

Analyze Data: SPSS

The data editor

The data editor provides a spreadsheet-like data editor window for creating and editing data files. It automatically opens when you start a session. Within the data editor window, there are two views: Data View and Variable View. 

Data view

The “Data View” tab displays the actual data.

  • Unique titles at the top of each column provide a description of what is in the column.
  • Columns often represent individual variables, and can be numbers or characters.
  • Rows often represent individual cases / observations.

To switch between Data View and Variable View, click on the tab at the bottom left.

 A screenshot of the SPSS software interface in Data View, showing four columns of data with one row per observation.

Variable view

The “Variable View” tab displays additional information about the data, including the type of data in each column, labels for each column (i.e., a description for the user), measure type for each column, et cetera. To switch between Data View and Variable View, click on the tab at the bottom left.

 A screenshot of the SPSS software interface in Variable View, showing four rows of data with additional metadata for each row.

Data entry

You can enter data directly into the data editor window in the data view tab. You can enter data in any order.

  1. In the data view, select a cell.
  2. Enter the data value. The value is displayed in the cell editor at the top of the data editor window.
  3. Click Enter button or select another cell to record the value.

Importing data

In addition to files saved in SPSS format, you can open a spreadsheet (Excel), Database (Access, dBASE), tab‐delimited file, and other types of ASCII text files without converting the files to an intermediate format.

Opening an SPSS file (*.sav)

  1. Click on File. Select Open. Select Data.
  2. To view all files, in the “Files of Type” drop-down menu, select the “All Files (*.*)” option.
  3. In the “Open File” dialog box, select the file you want to open.
  4. Click Open.

Opening an Excel file (*.xls)

  1. Click on File. Select Open. Select Data.
  2. To view all files, in the “Files of Type” drop-down menu, select the “Excel *.xls *.xlsx, *.xlsm” option.
  3. In the “Open File” dialog box, select the file you want to open.
  4. Click Open.
  5. The following dialog box appears

Opening a Text file (*.txt, *.dat, or *.csv)

  1. Click on Files>Open>Data.
  2. To view all files, in the “Files of Type” drop-down menu select the “All Files (*.*)” option.
  3. In the “Open File” dialog box, select the file you want to open.
  4. Click Open.

Using the Text Import Wizard

  1. If the data follows a predefined format (previously saved from the text wizard), click “Yes” and browse for the file defining the format. If the data is not in a predefined format, click “Next”.
  2. The Text Import Wizard needs to determine where the data for one variable ends and the data value for the next variable begins. If the first row of the data file contains descriptive labels for each variable, you can use these labels as variable names.
  3. If the first row of the data file contains descriptive labels for each variable, then select the row number the data begins. You will need to specify how cases are represented in the data file. Cases can span over one or more lines. SPSS can import the full dataset or a partial dataset.
  4. Characters or symbols used to separate variable / columns. Text strings can be enclosed in either single quotations, double quotations, or other symbols.
  5. By clicking on the variable name in the Data preview window, you can change the variable name and data format.
  6. You can save your specifications in a file for use when importing similar text data files. You can also paste the syntax generated by the Text Import Wizard into a syntax window.

Compute variables

The “Compute Variable” option is in the “Transform” tab, and computes values based on numeric transformations of other variables. For example, Compute Variable can be used to:

  • add, subtract, divide, multiply, or square the values in one or more columns
  • convert measurements (e.g., weight from pounds to kilograms)
  • conditionally generate a computation based on a specified condition

A screenshot of the SPSS software showing the "Compute Variable" pop-up box overlaid on the Data View interface.

How to compute variable:

  1. Click on Transform. Select Compute Variable.  
  2. In the text box labeled “Target Variable”, type in a variable name where the calculation result is to appear. It can be an existing or new variable name; If you choose to type in an existing variable, the values of this variable will be overwritten.
  3. To build an expression (calculation), either paste components or type directly into the “Numeric Expression” field. 
  4. If you want the calculation in question to only be applied to a certain subset of the data, click on the ‘If’ button (located at the bottom of the Compute Variable window) and use the “Include if cases satisfies condition” button. 

Split the file

The “Split file” option is in the “Data” tab. This allows you to temporarily split your data into different groups based on one or more grouping variables. By default, the file is not split; if you split the file, statistics that you run will be grouped by whichever grouping variable you use unless you return to the default (i.e., not splitting the file).

A screenshot of the SPSS software showing the "Split File" pop-up box overlaid on the Data View interface.

How to split a file

  1. Click on Data. Select “Split File”. 
  2. The program can split the data either by “Compare groups” or “Organize output by groups”.
  3. In the “Groups Based on” box, place the splitting variable(s), which should be nominal or ordinal. 

Suggest an edit to this guide

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.