SPSS for Windows provides a powerful statistical analysis and data management system in a graphical environment. It is thus imperative that a typical SPSS user be familiar with basic spreadsheet concepts. Specifically,

  • Highlighting
  • Cut, Copy & Paste
  • Mouse movements
  • Dialog boxes, radio button, & check boxes
  • Windowing features
  • Using the Online Help

Objective

This course provides an introduction to the SPSS spreadsheet-like interface. Specifically, we will review the SPSS windows (mentioned below) and execute a small SPSS program. In the interest of time we will not type in any data but use the Anxiety.sav SPSS sample data file. Thus the section on Entering and Editing Data is provided only for reference.

The Four Windows of SPSS

The SPSS Data Editor
This is a spreadsheet-like system for defining, entering, editing, and displaying data.

The SPSS Syntax Editor
This is a text editor system for syntax composition

The SPSS Output Navigator
This is a results and log window. All output and errors are displayed in this window.

The SPSS Script Editor (SPSS Base 10.1 for Windows, User’s Guide, Chapter 42)
The scripting facility allows you to automate tasks in SPSS, including

  • Customizing output
  • Opening and saving data files
  • Display and manipulate dialog boxes
  • Run data transformations and statistical procedures using command syntax
  • Export charts as graphics files in a number of formats

Starting SPSS

From the Start menu select Programs -> SPSS for Windows -> SPSS 10.0 for Windows
The Default Screen that appears is SPSS for Windows – What would you like to do?
Click on the Type in data radio button
Click the OK button
The SPSS Data Editor screen should start

Entering & Editing Data

  1. To enter numeric data simply type the numbers down a column.
  2. To enter character (string) data
    • Click on the Variable View tab at the bottom of the window
    • Click on the cell in row 1 under column Name
    • Type in the variable name
    • Press [Tab] to advance to the Type column
    • Click on the ellipsis (…) to view the selection of types
    • Change the choice to String
    • Make sure the number in the Characters box matches the maximum string length
    • Click on OK
  3. Naming Variables
    • From Variable View, place the the cursor in the row that corresponds to the column order of the variable data set (they are rotated here from Data View).
    • Type in the variable name
    • Click OK

Retrieving Data

  1. Click on File in the Data Editor window
  2. Choose Open then Data
  3. Change to the appropriate Look in folder. (SPSS example data files are in P:IITSapplSpss)
  4. Choose Anxiety (file type is *.sav)
  5. Click OK

Saving the Data

  1. Click on File in the Data Editor window
  2. Choose Save As
  3. Make sure the Save in folder points to the correct folder. For example: 3 Floppy (A:)
  4. SPSS Data files saved from the Data Editor Window must have the Save as type listed as SPSS (*.sav)
  5. Type a file name in the File name box. For example: Ex1
  6. Click on Save

Performing the Analysis

Analysis may be generated using the Statistics menu or the Command Syntax file. The creation of the Command Syntax file and using it to perform analysis will be discussed later in this document. All discussion in this section uses the Statistics menu to generate an example of data summarization.

  1. Click on Analyze
  2. Click on Descriptive Statistics
  3. Click on Frequencies…
  4. Select the variables for analysis
    • Click on Anxiety
    • Click on the right facing arrow button
    • Similarly, select any or all variables.
  5. Make sure the Display frequency tables box is checked
  6. Click on Statistics…
  7. Customize the frequency output
  8. Click on Continue
  9. Click on Charts…
  10. Choose the Chart Type
  11. Click on Continue
  12. Click on OK when all customization is done

The SPSS Viewer

All SPSS statistical results are presented in the Viewer window. The window is divided into two sections. The left section is like a table of contents. If you see a plus sign next to the book icon, click on it once. The plus sign will now change to a minus sign and the tree will be expanded. Eventually you will see the entire output list. To jump to a particular output section simply click on the name.
The right section of the Viewer is where the analysis is presented. Use the scroll bars to page within the section.

Printing

Print is related to the active window. Therefore, to print the analyses make sure the active window is the Viewer. Similarly, to print the data make sure the SPSS Data Editor is the active window.

Creating a Syntax File

A command syntax file is a simple text file containing SPSS command syntax. For details on Working with Command Syntax see Chapter 11 of the User’s Guide. The file can be created in one the following ways:

  • using any text editor
  • pasting dialog box selections
  • pasting from the output log
  • editing the SPSS journal file (created in the windowstemp directory)

Command Syntax rules and each of the four methods is described next.

Command Syntax Rules

Keep in mind the following simple rules when editing and writing command syntax:

  • Each command must begin on a new line and end with a period.
  • Most subcommands are separated by slashes (/). The slash before the first subcommand is usually optional.
  • Variable names must be spelled out fully.
  • Text included within apostrophes or quotation marks must be contained on a single line.
  • Each line of command syntax cannot exceed 80 characters.
  • A period (.) must be used to indicate decimals, regardless of your Windows regional settings.
  • Variable names cannot end in a period.
  • Command syntax is case insensitive.

Using a Text Editor to Create a Syntax File
This option assumes that you are familiar with SPSS commands. The option especially enables the expert SPSS user to save his/her programs, that were written for a prior release of SPSS. Follow the instructions of the Text Editor to create and save SPSS program files to disk. The suffix for the SPSS program files is (*.SPS).

Using the Dialog Box Selections to Create a Syntax File
It is also possible to create a syntax file for later use by pasting dialog box entries. To create a syntax file via the dialog box option:

  1. Use the Analyze menu to start setting up your analysis.
  2. As you begin selecting options in the analysis dialog boxes the Paste button becomes active.
  3. Click Paste after completing your selections for the particular analysis.

The command syntax is pasted to the active file in the SPSS Syntax Editor window. The information in the Syntax Editor window can then be saved to disk for later use. Make sure the suffix for the SPSS program files is set to (*.sps). This is the default extension when the Save as type is set to SPSS Syntax Files (*.sps).

Using the Output Log to Create a Syntax File
The following steps outline the use of the Output Log to create a Command Syntax file.

  1. Before running the analysis, from the menus choose: Edit then Options
  2. Select the Viewer tab.
  3. Check the Display commands in the log check box.
  4. Click OK.
  5. Open a previously saved syntax file (File -> Open) or create a new one (File -> New -> Syntax).
  6. Run the analysis using the Analyze menu from the Data Editor window.
  7. In the Viewer, click on an SPSS Log item to activate it.
  8. Use the copy & paste concept of Windows to copy from the Viewer and paste to the Syntax window.
  9. Save the Syntax Window for later use.

Using the Journal File to Create a Syntax File
By default, SPSS records all commands executed during a session to a journal file named spss.jnl . Open the journal file using the text editor of your choice. The journal file is located in the Windows temporary directory (usually: c:windowstemp). Copy from the journal file and paste to the Syntax window. Make sure you remove (delete) all notes and warning messages. Save the Syntax window for later use.

Using the Run Command Syntax

  1. Highlight the commands you want to run in the Syntax Window.
  2. Click the Run button (right facing arrow button) on the Syntax Editor toolbar.
    OR
    Alternatively, select Run menu and choose the appropriate options to run the syntax file.

Other Useful Menu Options

Menu Item Description
Edit Similar to Windows Edit menu. Also includes options for special SPSS customization.
Data Includes options to manipulate variables, cases, and files.
Transform Includes options to perform functions on variables, interpolate data set elements, and work within a series.
Graphs Includes options to customize and create several types of graphs and charts, from simple bar charts to Q-Q plots.

Reading External ASCII (Raw or Text Data) Files

  1. From the menus choose File
  2. Click on Read Text Data
  3. Select the file to be processed
  4. Click Open
  5. Follow the six steps of the Text Import Wizard
  6. Click the Finish button to complete the import process

Reading Excel (version 5 or later) Files

To read Excel 5 (or greater) files into SPSS:

  1. From select the Data Editor, select File -> Open -> Data
  2. For Files of type: select Excel (*.xls)
  3. Select the correct folder and click on the Excel file to be imported
  4. Click on Open
  5. If the workbook has multiple worksheets, a drop-down box labeled Worksheet: will allow selection of the worksheet to be imported (note that only one worksheet may be selected for import into a session of the Data Editor)

Other External File Formats Supported

The following file formats are supported directly through the File / Open menu. This is not a comprehensive list.

  1. Excel Worksheets (prior to version 5)
  2. Lotus 1-2-3 (versions 3.0, 2.0, and 1A)
  3. Dbase (versions IV, III Plus, III, and II)

Using Help

The SPSS System provides online Help in several ways:

  1. Help Menu
  2. Dialog box context menu Help – activated using the right mouse button on any control in a dialog box and selecting What’s This?
  3. Dialog box Help buttons
  4. SPSS Tutorial – Choose Tutorial on the Help menu
  5. Statistics Coach – provides general assistance for many of the basic, commonly used statistical techniques. Choose Statistics Coach from the Help menu.