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.

Free tutorialFree practiceAbout 5 minutes5 practice questions

Quick answer: How do you use Data View and Variable View in SPSS?

  1. Open your .sav file. Data View shows one row per participant (case) and one column per variable.
  2. Click the Variable View tab to set each variable’s Name, Label, Values, Missing and Measure.
  3. Use value labels for codes, such as 1 = Male and 2 = Female.

Last updated November 2026 · Not sure this is the right test? Try the Which statistical test? tool.

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

Meet the Data Editor

When you open a data file, SPSS shows the Data Editor. It looks like a spreadsheet, but every row and column has a fixed job. Tap a number to jump to its note.

survey.sav [DataSet1] – SPSS Statistics Data Editor
FileEditViewDataTransformAnalyzeGraphsUtilitiesExtensionsWindowHelp1
2
idgender3agescorevarvar
14112172
22234565
3321988
4412754
5522279
6614561
7723070
Data ViewVariable View6
  1. 1
    Menu barEvery analysis starts here. You'll mostly use Analyze, plus Data and Transform to prepare your data.
  2. 2
    ToolbarShortcuts for opening, saving, recalling recent dialogs and showing value labels. The menus do the same jobs.
  3. 3
    Variable namesEach column is a variable: one thing you measured, such as gender or age. "var" columns are still empty.
  4. 4
    Row numbersEach row is a case, usually one participant. Row 3 is the third person in the file.
  5. 5
    A cellOne value for one person. Participant 2 is 34 years old.
  6. 6
    View tabsSwitch between Data View (the values) and Variable View (the settings for each variable).

Variable View

Variable View is where you tell SPSS what each column means. Set it up once and every table and chart you produce becomes readable.

survey.sav [DataSet1] – SPSS Statistics Data Editor
FileEditViewDataTransformAnalyzeGraphsUtilitiesExtensionsWindowHelp
Name1Type2WidthDecimalsLabel3Values4Missing5ColumnsAlignMeasure6Role
1idNumeric80Participant IDNoneNone8Right NominalInput
2genderNumeric80Gender{1, Male}…None8Right NominalInput
3ageNumeric80Age in yearsNone998Right ScaleInput
4scoreNumeric82Exam score (%)NoneNone8Right ScaleInput
Data ViewVariable View
  1. 1
    NameThe short name used in menus and syntax. It must start with a letter and can't contain spaces or hyphens: exam_score, not exam score.
  2. 2
    TypeNumeric for numbers and codes, String for text. Store groups as numeric codes (1, 2) so you can analyse them.
  3. 3
    LabelThe full description shown in your output, such as "Exam score (%)".
  4. 4
    ValuesValue labels turn codes into words: 1 = Male, 2 = Female. Click the cell, then the small … button. In Data View, View › Value Labels shows words instead of codes.
  5. 5
    MissingCodes that mean "no answer", such as 99. SPSS leaves them out of every calculation.
  6. 6
    MeasureNominal, Ordinal or Scale. That's the next lesson.

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.

More in Find your way around