Unit 1 · Find your way around
Data View and Variable View in SPSS
Learn the SPSS Data Editor: what rows, columns and cells mean, and how to set names, labels, value labels and missing values in Variable View.
Quick answer: How do you use Data View and Variable View in SPSS?
- Open your .sav file. Data View shows one row per participant (case) and one column per variable.
- Click the Variable View tab to set each variable’s Name, Label, Values, Missing and Measure.
- Use value labels for codes, such as 1 = Male and 2 = Female.
How SPSS organises data
SPSS stores your study as a table. Each row is a case, usually one participant, and each column is a variable: one thing you measured or recorded about every case, such as age, gender or a questionnaire item. The Data Editor has two tabs. Data View shows the values themselves. Variable View holds the settings for each variable, which SPSS uses to label your output and decide what analyses make sense.
When to use it
- Every time you enter data or open a new file.
- Before any analysis, to check that each variable is set up correctly.
- When you inherit a data file and need to understand what the codes mean.
How it works
Groups such as gender or condition are stored as numeric codes (1, 2, 3) rather than words, because statistics need numbers. Value labels tell SPSS what each code means, so output tables say “Female” instead of “2”. Missing value codes, such as 99 for “no answer”, tell SPSS to leave those values out of calculations.
Worked example
In a survey of 100 students, row 37 holds every answer from student 37. The column “gender” holds 1 or 2, and in Variable View the Values cell says 1 = Male, 2 = Female.
Key terms
- Case
- One row: the unit you measured, usually a person.
- Variable
- One column: a characteristic that varies between cases.
- Value label
- The words attached to a numeric code.
- String variable
- A text variable. It can’t be used in most analyses.
Common mistakes
- Putting more than one participant in a row, or one participant across several rows (unless your design needs long format).
- Typing words such as “Male” instead of numeric codes.
- Leaving “99” or “-1” as real numbers instead of declaring them missing.
- Using spaces or starting variable names with a number.
How to do it in SPSS
The SPSS syntax
Prefer typing to clicking? Open File › New › Syntax, paste this in, select it and choose Run › Selection. Every dialog's Paste button writes the same kind of code.
* Show every variable's settings (the same information as Variable View).
DISPLAY DICTIONARY.
* Label a variable and its codes.
VARIABLE LABELS gender 'Gender'.
VALUE LABELS gender 1 'Male' 2 'Female'.Practice data
Download the file used in this lesson and run it yourself in SPSS: you should get the same results as the screens above.
- students.savStudent survey: gender, age, course, exam score and attention check (N = 100)
Now practise it interactively →
Reading is only half of it. Tap through the real SPSS menus, read the output and pick the right write-up in 5 quick questions, with instant feedback on every answer.
This lesson’s practice is free. No sign-up needed to start.