Skip to content
Tutorials Center
My learning

Topics

Lesson 3 of 39 ยท Getting Started

A First SPSS Session: From Opening Data to Reading Output

Walk through a complete first SPSS session: open a data file, inspect Variable View, run Frequencies and Descriptives, read the output tables, paste syntax and save your work.

The fastest way to learn SPSS is to do one small analysis from start to finish. In this lesson you open a dataset, look at it, run two basic procedures, read the results and save your work. We use an imaginary survey file called cafe_survey.sav with 120 customers. You can follow along with any dataset of your own that has a categorical variable and a numeric variable.

The variables in our imaginary file:

Name Label Type
id Customer ID Numeric, identifier
gender Gender Categorical: 1 = Female, 2 = Male, 3 = Other
age Age in years Numeric
visits Visits last month Numeric (count)
rating Satisfaction (1 to 5) Ordinal

The values we discuss are illustrations; we do not claim real output for this file.

Step 1: Start SPSS and open the data

When SPSS starts it may show a welcome dialog. Choose to open an existing file, or close the dialog.

  1. Choose File > Open > Data....
  2. In the dialog, set Files of type to SPSS Statistics (*.sav) (it is the default) and select your file.
  3. Click Open.

Two windows now exist: the Data Editor with your data, and the Output Viewer that already shows the command that ran (a GET FILE= line) in its log. If you prefer, you can run this from syntax:

TEXT
GET FILE='C:\data\cafe_survey.sav'.
DATASET NAME cafe WINDOW=FRONT.

Step 2: Look at Data View and Variable View

At the bottom left of the Data Editor are two tabs. Data View shows a spreadsheet: row numbers on the left are case numbers, column headings are variable names. Variable View shows one row per variable with the columns Name, Type, Width, Decimals, Label, Values, Missing, Columns, Align, Measure and Role.

Always visit Variable View first. It tells you:

  • what each variable means (Label);
  • what the numbers stand for (click the Values cell for a variable like gender);
  • how many decimals and what type it is;
  • the Measure: Nominal, Ordinal or Scale (see statistics basics for SPSS);
  • which codes count as missing (Missing).

In Data View, toggle View > Value Labels (or the icon with a tag) to switch between codes (1, 2, 3) and their labels (Female, Male, Other). It only changes the display, never the data.

Step 3: Frequencies for a categorical variable

A frequency table counts how often each value occurs.

  1. Analyze > Descriptive Statistics > Frequencies...
  2. Move gender into Variable(s) with the arrow.
  3. Keep Display frequency tables ticked.
  4. Click Charts... and choose Bar charts, Continue.
  5. Click OK.

The Output Viewer then shows a Statistics table (N Valid and N Missing), a Frequency Table and a bar chart. The frequency table has five columns:

Column Meaning
Frequency Count of cases with this value
Percent Frequency divided by all cases, including missing
Valid Percent Frequency divided by cases that have a valid (non-missing) value
Cumulative Percent Running total of Valid Percent in the order shown

The difference between Percent and Valid Percent trips up many beginners, so we build it by hand below.

Python Stand-in: build a frequency table like SPSS

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice that Valid Percent adds up to 100 over the valid values, while Percent adds up to 100 only once the Missing row is included.

Step 4: Descriptives for a numeric variable

For a scale variable such as age, counting every distinct value is useless. Use summary numbers instead.

  1. Analyze > Descriptive Statistics > Descriptives...
  2. Move age and visits to Variable(s).
  3. Click Options... and tick Mean, Std. deviation, Minimum and Maximum (these are often the defaults), then Continue.
  4. OK.

You get a single table called Descriptive Statistics with one row per variable: N, Minimum, Maximum, Mean and Std. Deviation. The bottom row, Valid N (listwise), counts cases that have a valid value on all the chosen variables.

Python Stand-in: what the Descriptives table computes

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Std. Deviation here is the sample standard deviation (divide by n - 1), which is what SPSS reports and what statistics.stdev computes.

Step 5: Read the output properly

In the Output Viewer, the left panel is an outline of everything produced; the right panel shows the items. Click an item in the outline to jump to it. Double-click a table to open it in the Pivot Table editor (change fonts, transpose rows and columns, edit labels). Right-click a table to copy it, export it or delete it. Press Delete on a selected outline item to remove it.

Read in this order: titles and the Notes (hidden by default, they list the data file and syntax), then the numbers. Ask three questions each time: How many cases were used? Are the values plausible? What does a missing value do here?

Step 6: Paste the syntax

Reopen a dialog (the last-used settings are remembered in Analyze > Descriptive Statistics > Frequencies, and SPSS has a Reset button), and this time click Paste instead of OK. The Syntax Editor opens with commands like these:

TEXT
FREQUENCIES VARIABLES=gender
  /BARCHART FREQ
  /ORDER=ANALYSIS.

DESCRIPTIVES VARIABLES=age visits
  /STATISTICS=MEAN STDDEV MIN MAX.

Select the lines and press the green Run triangle (or Ctrl+R, Run > Selection). Each command ends with a period. The results appear in the Output Viewer exactly as before. Syntax is the best way to keep a record of what you ran.

Step 7: Save your work

You now have three things that can be saved separately.

  1. Data: File > Save (or Save As...) writes the .sav. If you changed nothing, there is nothing to save.
  2. Output: click in the Output Viewer and choose File > Save. This writes a .spv.
  3. Syntax: click in the Syntax Editor and File > Save. This writes a .sps.

Give related files the same stem (cafe_survey.sav, cafe_survey_01_explore.sps, cafe_survey_01_explore.spv) so you can find them again.

Common mistakes

  • Running analyses with the wrong dataset active when more than one is open. The active dataset is the one named in the Data Editor toolbar's dataset drop-down and marked with a red plus sign in the Window menu.
  • Reading Percent when you wanted Valid Percent.
  • Closing the Output Viewer without saving, then losing the tables.
  • Computing a mean of a nominal code, such as the mean of gender, which has no meaning.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A frequency table shows 4 missing cases out of 120. Valid Percent for 'Female' (66 cases) is based on:

    Valid Percent divides by the number of valid cases (120 - 4 = 116). Percent divides by all 120.
  2. 2. Which menu path produces a frequency table?

    Frequencies lives under Analyze > Descriptive Statistics.
  3. 3. What does 'Valid N (listwise)' in the Descriptives table mean?

    Listwise counts only the cases that are non-missing on every listed variable.
  4. 4. You click Paste instead of OK in a dialog. What happens?

    Paste writes the syntax so you can save, edit and run it later.

Summary

  • Open data with File > Open > Data, then inspect Variable View before analyzing.
  • Frequencies summarizes categories; Descriptives summarizes numeric variables.
  • Percent includes missing cases in the base; Valid Percent does not.
  • The Output Viewer outline lets you navigate and delete results; tables can be edited as pivot tables.
  • Use Paste to turn dialogs into syntax, and save the .sav, .sps and .spv files separately.

Next: Statistics Basics for SPSS Users