This chapter will help you to:

  1. Identify the windows used in SPSS
  2. Describe the function of each window
  3. Navigate through the menu bar in SPSS
  4. Enter data into SPSS
  5. Import data into SPSS
  6. Save SPSS files
  7. Capture images of your screen

SPSS Structure

SPSS has a storied past. It is not a story that is very interesting and we will not spend time on it here. Instead, we’ll fast-forward to 2020. SPSS stands for “Statistical Package for the Social Sciences” and it is owned by IBM. It is widely used in the social sciences (e.g., psychology, sociology, economics, etc.) in part because of its ability to do many analyses but more because of the ease of use. One can perform most analyses in SPSS without needing to do any coding but SPSS has the flexibility to do much more through its syntax.

Three Windows

The program uses three windows.

  1. The Data Editor: This window houses the data and defines the properties of the data.
  2. The Syntax Editor: This window allows users to tell SPSS what to do with code.
  3. The Output Viewer: This window contains the results of what you ask SPSS to do.

The Data Editor

The data editor window (see Figure 2.1) looks like a spreadsheet (e.g., Microsoft Excel or Google Sheets) but it is not. Whereas spreadsheets have the ability to do calculations in a cell, the data editor can only hold values.

Figure 2.1

The Data Editor Window

Data Editor Window

The Data Editor Window consists of two tabbed views (see the bottom-left corner of Figure 2.1). The first is the data view, which holds the actual values. The second is the variable view, which contains the properties for each variable. Although the data view is the one you see initially when opening a file, I think it is best if we start with the variable view.

The Variable View

Figure 2.2

The Variable View of the Data Editor Window

Variable View Tab

The variable view tab (pictured in Figure 2.2) is where you’ll want to tell SPSS about the variables in your data set. This is important because the guesses that SPSS makes about your variables can be wrong. If your variable properties are not set correctly, SPSS may block you from running a procedure or it may misrepresent the output. ALWAYS CHECK THE VARIABLE VIEW. Really, ALWAYS.

The variable view seems to have a similar layout to the data view (i.e., cells from the intersection of rows and columns) but the major difference lies in what goes in each cell.

Each row represents one variable and the columns hold the values for the various properties for the variable. Those properties include:

  • Name: This is a special, shortened version of what you call your variable. SPSS does not like spaces or special characters (e.g., $ / or .). You can use underscores (i.e., _)

  • Type: The sets the kind and format of data for the variable. Unless it is something that you will not analyze, it should be “numeric”. If it has a special formatting like money (e.g., starts with “$”) or is in scientific notation (e.g., “10E4”), you can specify that. To change the type, click on the cell under the “Type” in the row for the variable you want to change. Click on the blue button with three dots (“…”) and a pop-up will open (see Figure 2.3).

Figure 2.3

Variable Type Pop-Up

Variable Type Pop-Up

We’ll cover the special case of variables that contain words rather than numbers. Although SPSS will let you type in letters, you won’t be able to do much with them. Rather than have a “string” variable, we’ll want to dummy code that variable into a numeric variable.

  • Width: This is how many characters you want to reserve to display values in the data editor. This is an old property that was used to allocate memory for variables back in the old days of computers when memory was a very limited resource. You won’t need to change this. SPSS will adjust it if needed.

  • Decimals: This one you will want to change. The default is to display two digits past zero, even if you only have whole numbers. If you will not have decimals, change this to 0. This is really important for dummy coding.

  • Label: Remember the special shortened variable name? It doesn’t look very good. Update the label column to how you want the variable name to appear when it is printed in the output (e.g., in a table or graph). It can contain special characters and spaces.

  • Values: Values are used to associate text labels with numeric values. This is what we’ll use for dummy coding. Stay tuned for details but this basically allows us to show “Male” anytime the value for “Gender” is set to 0, for example.

  • Missing: There are often gaps in our data sets. Someone may have not responded, there may have been a recording issue, or we may not be able to read the response. Whatever the reason, you should specifiy, explicitly, when a value for a variable is missing. Open the pop-up dialogue box to select “Discrete missing values” and enter values that signify missing (see Figure 2.4). I suggest using outlandish values that are not possible for your variable. For example, “275” is not possible for number of children.

Figure 2.4

Missing Values Pop-Up

Missing Values Pop-Up
  • Columns: This is another holdover from days-gone-by. It specifies how wide the variable column should appear in the data view. I suggest you just change the width by dragging the column wider or more narrow in the data view.

  • Align: The default is for the values to align to the right of the cell in the data view but you can choose “left” or “center,” if you wish.

  • Measure: This one is important! SPSS has some baked-in rules about which graphs and analyses are appropriate for different scales of measurement. Furthermore, SPSS will guess the scale of measurement but it is often wrong or at least overly strict with rules. It is best if you think about your data and the analyses you want to perform befores setting your analyses. Just a hint: set numeric variables as “scale” if you want to caluclate means or anything that relies on means. In SPSS lingo, scale = “interval” or “ratio” scales.

  • Role: The role property is outside of the scope of this class as it is used in modeling aspects of SPSS which we will not cover. You can leave this property as is.

Remember, ALWAYS CHECK THE VARIABLE VIEW. With the variable properties set for our variables, we can input data through the data view tab.

The Data View

As mentioned before, although the data view looks like a spreadsheet, it is not. It simply a way to hold the values of different variables for different “entities”. By entities, I mean that from which you got the data (was that even intelligible?). In psychology, we often record data from a person. We could also have data about a group or a state, etc.

Any data that came from that enttity will be put in a single row with each cell corresponding to a different variable. If you have variable set up, you should see the variable names as the column headers. The columns for which no variable is set will appear as a grayed-out “var.”

By the way, this “wide” format for data entry is required by SPSS but can cause some difficulties later for repeated-measures analyses. There are work-arounds but it isn’t perfect.

The only tricky bit with the data view involves those dummy coded values. If you have dummy codes (i.e., numbers that represent text values), you can see the text instead of the numbers by clicking the “Value Labels” button in the toolbar (see Figure 2.5).

Figure 2.5

Value Labels Button in Toolbar

Value Labels Button in Toolbar

We’ll next take a quick look at the syntax editor window.

The Syntax Editor

A long, long time ago, before many of my student were born, SPSS and all computer programs did not have a “point-and-click” interface. Rather, one had to type in commands nto a console. That may sound terrifying at worst and inconvenient at best but you won’t need to worry too much about this archaic world of code. You won’t need to worry but you will need to see it and use it.

Figure 2.6

The Syntax Editor Window

Syntax Editor Window

The syntax editor (see Figure 2.6) has two part. The main part, on the right, is where you enter the syntax (i.e., code). It is like a souped-up text editor because of a few useful features. As you type keywords, it will offer suggestions to complete the keyword. It also changes the color of text depending on the role of the word you type (e.g., command, option, variable, etc.).

Although I won’t ask you to write but more than a few lines of syntax, it is helpful to pay attention to the syntax and to use it to your advantage. You should utilize syntax to

  • Create a record of the analyses you preformed
  • Re-run previously ran procedures
  • Comment about your procedures
  • Easily share procedures with others

SPSS makes generating syntax really easy. Before you finish a procedure using the point-and-click interface, you can click the “paste” button in the bottom of the window. The associated syntax is then inserted at the end of your syntax file. You can then add comments or change the syntax as you’d like. You can also copy and paste syntax within the editor. This is a time saver when you want to re-run an analysis but with a different variable, for example.

To run syntax from the editor, highlight the syntax by clicking and dragging across the section you want then click the big green “play” button in the toolbar.

To insert a comment, star the line with an asterisk (*) and end it with a period (.). That period is a crucial bit for syntax because, like in the syntax of a sentence, it indicates the end. Many students who run into issues with syntax are because of incomplete (i.e., no ending period) statements.

The other part of the editor, on the left side, is a like a table of contents. As your syntax file grows, this can help you quickly find and run code. Your comments will show up here so if you’ve used appropriate comments, you can quickly scan to the right area of the file.

The Output Viewer

The output viewer window is were you find the results of your analyses, your graphs, and associated syntax that was run to produce the output. Anytime you do something that requires SPSS to generate and run syntax, the output view will make record of it and show the result, unless you are calculating or transforming variables. In that case, the changes are found in the data editor window.

The structure of the output window somewhat mirrors that of the syntax editor with a table of contents on the left and the actual contents on the right (see Figure 2.7).

Figure 2.7

The Output Viewer Window

The Output Viewer Window

The output viewer window is more than a viewer; you can actually edit the output, too. This is generally done by double-clicking the item (e.g., a graph or table) that you want to edit. If it is small, you can edit right in the output window. If it is larger, a pop-up editor may open.

If you want to share the results of your analyses (e.g., the content of the output viewer window), you should put it into another file format. Although many in academia and perhaps some in larger corporations have access to SPSS, many do not. SPSS understands this and offers a freely-downloadable standalone output viewer application but that is an extra step. Instead, you can easily export the contents of the output viewer window as a web report, a word file, or image files.

With the major windows introduced, we can now see how SPSS is used

Using SPSS

The Menu Bar

You have two options for using SPSS. Option 1 is to type and execute syntax. If you want to use syntax exclusively, I would suggest that you learn a more flexible and powerful language (e.g., Python or R). Option 2 is to use the menu bar (see Figure 2.8)

Figure 2.8

The Menu Bar

The Menu Bar

File

Use this menu to create, open, or save files. SPSS DOES NOT AUTOSAVE. You must use this menu often (more at the end of this chapter)

Edit

Copy, paste, undo, redo, etc. You can likely do most of these through keyboard shortcuts. Table 2.1 shows some common and useful keyboard shortcuts for both PC (i.e., Windows based computers) and Mac (i.e., Apple computers)

Table 2.1

Common Keyboard Shortcuts for PC and Mac

Command PC Mac
Copy CTRL + C CMD + C
Paste CTRL + V CMD + V
Undo CTRL + Z CMD + Z
Redo CTRL + Y CMD + Y
Save CTRL + S CMD + S
Switch Windows ALT + TAB CMD + TAB
Screenshot Windows + Shift + S Shift + CMD + 3

View

If you want to change how SPSS looks, you can set options here.

Data

This menu is used to adjust, restructure, or manipulate your data set. The only option we’ll use here is “Split File” to run analyses on subgroups of our data (based on values of a variable), simultaneously. If you wanted to run analyses on just one subset, you could use “Select Cases” instead.

Transform

If you need to change a variable or multiple variables through a formula, you’ll find the command in this menu. In this class, the most we’ll use is the “Compute Variable” option to set up a new variable.

Analyze

This is the bread-and-butter of SPSS. What I mean is that this menu really contains the essence of SPSS for a statistical software package. If you want to learn something about your data or if you want to make some guesses about populations based on your data, this is the menu you should use. There is a rich set of tools in this menu but to great to cover in one class. In fact, for this class, we’ll only use some of the options under “Descriptive Statistics” and we’ll use the “General Linear Model” submenu.

Graphs

I’m thinking of writing a book in the style of “If you give a mouse a cookie.” It will go something like this, “If you give a statistician a model, he’ll probably want some figures to go with it.” I’m not sure if every picture is worth a thousand words but a figure can nicely convey information in a succinct way that tables cannot. We’ll spend some time with the “Chart Builder”. However, we’ll have to use the “Legacy Dialogs” options to produce figures for the repeated measures designs.

I’m intentionally skipping over the Utilities and Extensions menus. We will not use anything from these for this course.

Window

I am going to spend some space on this menu because it is really handy when you can’t find your syntax or output windows. Upon occasion, your window will not pop to the front of the stack of windows when you click “Paste” or “Run.” If you go to the “Window” menu, you can select the window you want to view.

Special note to Mac users: SPSS will sometimes open a window but it will be just the three buttons from the top right and it will appear in the bottom corners of your screen. If clicking on the window you want to see in the “Window” menu doesn’t work, the window may be hiding in plain sight at the bottom of the screen.

Adding Data

Let’s give SPSS some data, shall we? This can be done in two ways. We can either manually enter the data or we can import it. We’ll walk through both, staring with entering the data manually.

Set the Variable Properties

Go to the data editor window (a new one should always open when you open SPSS. Unless you intentionally are opening a data file associated with SPSS). Click on the “Variable View” tab in the bottom-left corner.

Name

Let’s add a “Happiness” variable by typing "Happiness into the “Name” field on the first line.

Type

Ensure that “Type” is set to Numeric (it should default to this).

Label

We’ll add a more descriptive label by typing “Happiness (Unipolar)” in the “Label” box. We’ll call it “Happiness (Unipolar)” because we’ll record the assumed other end of that continuum “Sadness” in another variable.

Dummy Coding in Values

Emotions are tough to assess so the best we often can get is a Likert-type scale. Let’s set one up for our Happiness variable by adding some value/label pairs in the “Values” field. Click on the first-row cell under “Values” then click the button with the three dots that appears in the cell (see Figure 2.9).

Figure 2.9

Open Values Window Button

Open Values Window Button

This will open the “Value Labels” window (See Figure 2.10). We will need to tell SPSS the dummy code in the “Value” box and the word we want to associate with that code in the “Label” box. Let’s start at the bottom with 0 for the value and “Not Happy” for the label. When you have the boxes filled, click the “Add button”. You must click “Add” after each value-label pair you enter.

Figure 2.10

Value Window

Value Window

This will move the value-label pair to the box in the center of the window (you’ll see 0 = “Not Happy”). Add in 1 = “Somewhat Happy”, 2 = “Happy”, and 3 = “Very Happy”, being sure to click “Add” after each pair.

When you are done, click the “OK” button in the bottom of the window to return to the Variable View.

Missing

Open the “Missing” pop up window by clicking on the three dot button in the cell in the “Missing” column. Choose “Discrete missing values” and enter a unlikely number to mark when there is no data for “Happiness.” I think 999 is very unlikely for a scale ranging from 0 to 3.

Click “OK” to return to the Variable View.

Measure

The last property we need to set is the scale of measurement. Likert-type scales are, strictly speaking, always assessed on an ordinal scale of measurement. However, if the data are roughly normally distributed, you can cautiously interpret the results as if the were from an interval scale. The big caveat is, of course, that we cannot claim that an increase from “not happy” to “somewhat happy” is the same magnitude of improvement as from “somewhat happy” to “happy”.

We’ll play it safe and set it to “ordinal”

Repeat for other variables.

Let’s set up a “Sadness” variable and a “Gender” variable by following the above steps.

Sadness

Here are the properties to set for “Sadness”

  • Name = “Sadness”
  • Type = “Numeric”
  • Label = “Sadness (Unipolar)”
  • Values
    • 0 = “Not Sad”
    • 1 = “Somewhat Sad”
    • 2 = “Sad”
    • 3 = “Very Sad”
  • Missing = 999
  • Measure = “Ordinal”
Gender

Here are the properties to set for “Gender”

  • Name = “Gender”
  • Type = “Numeric”
  • Label = “Gender”
  • Values
    • 0 = “Man”
    • 1 = “Woman”
    • 2 = “Transgender”
    • 3 = “Genderqueer”
    • 4 = “Androgynous”
    • 5 = “Other”
  • Missing = 999
  • Measure = “Nominal”

The final Variable View should look like Figure 2.11

Figure 2.11

Completed Variable View

Completed Variable View

The variable properties are set so we can proceed to data entry.

Entering Data

Entering data in SPSS is as easy as typing the value in the cell. We just need to ensure that the value we are typing corresponds to the right variable and right person. Always check your data entry to ensure it matches your data source.

If any of your variables are dummy coded, you may want to click that “Value Labels” button in the toolbar. This will allow you to see the labels associated with dummy codes you’ve entered. Also, it will allow you to type the label instead of the dummy code (See Figure 2.12).

Figure 2.12

Typing Dummy Code Label

Typing Dummy Code Label

Enter the following data into the Data View.

Happiness Sadness Gender
Not Happy Very Sad Man
Very Happy Not Sad Woman
Happy Somewhat Sad Man
Somewhat Happy Sad Woman
Very Happy Not Sad Man
Happy Somewhat Sad Woman
Happy Sad Man
Somewhat Happy Sad Woman
Somewhat Happy Very Sad Man
Not Happy Very Sad Woman

When you’re done, the data view should look like Figure 2.13.

Figure 2.13

Completed Data View

Completed Data View

Importing Data

Often, you’ll sharing data with collaborators or you’ll compile the data in a spreadsheet like Excel. In this case, you’ll want to import your data into SPSS. The import process extracts the data from the original file and inserts it into the SPSS file. I recommend working with Comma Separated Values (CSV) files as it is fairly universal file type for data.

Download the import example file for this portion. Be sure to “save as” instead of “open.” On most computers, a CSV file will open in Excel. You cannot import a file that is currently open in Excel. If you do accidentally open the CSV in Excel, save it to your computer (perhaps in Downloads) and close the file. You can then import into SPSS.

To start the import process, go to the “File” menu then hover over “Import Data”. Click on “CSV Data” (see Figure 2.14).

Figure 2.14

Import CSV Menu

Import CSV Menu

You’ll then be directed to select the file which you wish to import. Navigate to the location of the file then select it. When the file is selected, click “Paste” (see Figure 2.15). This will produce some of the necessary syntax to import the file.

Figure 2.15

Selecting the Correct File

Selecting the Correct File

The main window for importing CSVs should now be on the screen (see Figure 2.16). The default settings should work 95% of the time but just be sure that if the variable names are the top line, that you check the first box under the preview box. Sometimes, if you have nominal data, SPSS may think that you have variable names included when the first line really contains data. If all looks right, click “Paste” in the bottom again.

Figure 2.16

Import Window

Import Window

If you are looking for your data after clicking “Paste,” you won’t find it just yet. Remember that clicking “paste” generates syntax only. You’ll also need to run the syntax. Figure 2.17 shows the resulting syntax.

Figure 2.17

Import Syntax

Import Syntax

Once the syntax has been run, you should see a new data editor window with values inserted by the import process. The data may look good but you must always check the variable view. Check out the variables and properties from the import in Figure 2.18. They need some attention.

Figure 2.18

Incorrect Variable View

Incorrect Variavle View

We’ve only mentioned this once but, SAVE YOUR DATA.

Saving Data

SPSS does not have an autosave function so you need to regularly save your files. Did you catch that? Files with an "s’, plural, multiple files. There is a file for each of the three window. The one the data editor has an .SAV file extension. The file for the syntax file is .SPS. Lastly, the file extension for the output window is .spv.

I recommend saving the files in the same location and saving them in the cloud. This will ensure that your files are accessible when and where you need it.

Screenshots

Sometimes, I may ask you to upload one of the files, such as the spv or the sps files. I am more likely to ask you for a specific component of the answer from your output or data editor. The easiest way to do this is to capture a screenshot.

On PC: Push the “windows” key to the left of the spaceabr. Then type “snip” and select the snipping tool from the search results. Click “new” to drag around the area you want to keep. You’ll then need to save it by pressing CTRL + S.

On Mac: Push CMD + SHIFT + 3 to capture the contents of the screen. You can move or edit the photo from the desktop.

Summary

SPSS is a user-friendly statistical program that has a point-and-click interface as well as syntax or code control of procedures. It consists of three windows, the data editor, the syntax editor, and the output viewer. Data can be entered manually or imported through a wizard.