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,
- Cut, Copy & Paste
- Mouse movements
- Dialog boxes, radio button, & check boxes
- Windowing features
- Using the Online Help
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
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
- To enter numeric data simply type the numbers down a column.
- 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
- 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
- Click on File in the Data Editor window
- Choose Open then Data
- Change to the appropriate Look in folder. (SPSS example data files are in P:IITSapplSpss)
- Choose Anxiety (file type is *.sav)
- Click OK
Saving the Data
- Click on File in the Data Editor window
- Choose Save As
- Make sure the Save in folder points to the correct folder. For example: 3 Floppy (A:)
- SPSS Data files saved from the Data Editor Window must have the Save as type listed as SPSS (*.sav)
- Type a file name in the File name box. For example: Ex1
- 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 handout. All discussion in this section uses the Statistics menu to generate an example of data summarization.
- Click on Analyze
- Click on Descriptive Statistics
- Click on Frequencies…
- Select the variables for analysis
- Click on Anxiety
- Click on the right facing arrow button
- Similarly, select any or all variables.
- Make sure the Display frequency tables box is checked
- Click on Statistics…
- Customize the frequency output
- Click on Continue
- Click on Charts…
- Choose the Chart Type
- Click on Continue
- 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.
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:
- Use the Analyze menu to start setting up your analysis.
- As you begin selecting options in the analysis dialog boxes the Paste button becomes active.
- 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.
- Before running the analysis, from the menus choose: Edit then Options
- Select the Viewer tab.
- Check the Display commands in the log check box.
- Click OK.
- Open a previously saved syntax file (File -> Open) or create a new one (File -> New -> Syntax).
- Run the analysis using the Analyze menu from the Data Editor window.
- In the Viewer, click on an SPSS Log item to activate it.
- Use the copy & paste concept of Windows to copy from the Viewer and paste to the Syntax window.
- 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
- Highlight the commands you want to run in the Syntax Window.
- Click the Run button (right facing arrow button) on the Syntax Editor toolbar.
Alternatively, select Run menu and choose the appropriate options to run the syntax file.
Other Useful Menu Options
|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
- From the menus choose File
- Click on Read Text Data
- Select the file to be processed
- Click Open
- Follow the six steps of the Text Import Wizard
- 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:
- From select the Data Editor, select File -> Open -> Data
- For Files of type: select Excel (*.xls)
- Select the correct folder and click on the Excel file to be imported
- Click on Open
- 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.
- Excel Worksheets (prior to version 5)
- Lotus 1-2-3 (versions 3.0, 2.0, and 1A)
- Dbase (versions IV, III Plus, III, and II)
The SPSS System provides online Help in several ways:
- Help Menu
- Dialog box context menu Help – activated using the right mouse button on any control in a dialog box and selecting What’s This?
- Dialog box Help buttons
- SPSS Tutorial – Choose Tutorial on the Help menu
- Statistics Coach – provides general assistance for many of the basic, commonly used statistical techniques. Choose Statistics Coach from the Help menu.