Why your SPSS file setup matters more than you think
Most thesis students open SPSS, type a few numbers into the Data View, and only discover the problems weeks later — when a variable turns out to be a string instead of a number, or a missing value quietly becomes a real score in the analysis. Data entry in SPSS is not just typing. It is the foundation every test, table, and conclusion in your thesis will stand on.
Setting up your SPSS file properly takes about an hour, and it saves many more hours of detective work later. The steps below walk you through it, from planning your variables to checking the finished file before you run a single analysis.
1. Plan your variables before you type a single number
Before you open SPSS, build a simple codebook — a document or spreadsheet with one row per variable. For each variable, note its name, what it measures, how it is coded, and what counts as missing. A codebook keeps your coding consistent and feeds straight into your methodology chapter.
For every variable, record:
- Name: short and descriptive, such as age, gender, stress_score.
- Type: Numeric for anything you will analyse statistically; String only for text such as participant IDs or open-ended comments.
- Codes: for example, gender: 1 = male, 2 = female, 3 = prefer not to say.
- Missing value: for example, 999 for a skipped age question, 9 for a skipped Likert item.
If you collected data with a questionnaire, go through it item by item and add each item to the codebook before you touch SPSS. Students who skip this step almost always end up re-entering or recoding data later.
2. Set up Variable View properly
SPSS has two views: Data View, where the numbers live, and Variable View, where you define what those numbers mean. Set up Variable View first — click the tab at the bottom of the window and work through each column:
- Name: Must start with a letter, contain no spaces, and can be up to 64 characters. Use underscores instead of spaces, for example sleep_hours.
- Type: Leave as Numeric for scores, ages, and coded categories. Choose String only for text. If SPSS guesses the wrong type when you paste data in, fix it here before you analyse anything.
- Width and Decimals: For whole-number codes such as 1–5 Likert items, set Decimals to 0. For measured values such as reaction times, keep 2 decimals.
- Label: Type the full question or description. Labels appear in your output tables and make them readable.
- Values: Click the cell, then the small button that appears, and enter each code with its meaning (1 = Male, 2 = Female).
- Missing: Enter your missing-value codes, such as 999. SPSS will then exclude them from calculations instead of treating them as real data.
- Measure: Set each variable to Nominal, Ordinal, or Scale. Gender is Nominal, a Likert item is usually Ordinal, and age in years is Scale.
Work through every variable in Variable View before entering a single value — ten minutes here prevents the most common thesis data disaster: discovering halfway through your analysis that half your variables are the wrong type.
3. Use value labels for every coded variable
A column full of 1s and 2s is meaningless without value labels. Every categorical variable — gender, education level, group membership, yes/no answers — needs a value label for every code you use.
Be consistent across your whole file: code all yes/no items the same way (0 = No, 1 = Yes), and use the same direction for every Likert scale (1 = strongly disagree through 5 = strongly agree). If any item is worded in the opposite direction, reverse-score it after entry rather than entering it backwards — that keeps your raw data a faithful record of what participants actually answered.
4. Decide how to handle missing data before you start
Missing data is normal in thesis research. Participants skip questions and pages get missed. What matters is deciding in advance how you will record a missing value, so it never gets confused with a real answer.
SPSS distinguishes two kinds of missing values. A system-missing value is an empty cell — SPSS shows a dot and automatically excludes it from analyses. A user-missing value is a code you choose, such as 99 or 999, which you declare in the Missing column of Variable View. Use a code that can never be a real answer: 999 works for age, 9 for a 1–5 scale.
Never leave a skipped question blank in one place and coded 999 in another — pick one approach per variable, record it in your codebook, and stick to it. And never code a missing value as 0 unless 0 is genuinely impossible as a real answer: a 0 that SPSS treats as a real score will drag your means down and distort every test that uses the variable.
5. Enter data one participant per row
The standard layout for thesis data in SPSS is one row per participant and one column per variable. This is called wide format, and it is the layout almost every SPSS procedure expects. Each participant gets exactly one row, and each cell holds one value — one answer to one question from one person.
- Enter codes, not words. Type 1 and 2, not “Male” and “Female”. Words belong in value labels, not in cells.
- Do not use merged cells, colours, or notes inside the data. Keep comments in your codebook, not in the data file.
- Keep participant IDs in the first column. A simple ID number (1, 2, 3, …) lets you trace any suspicious value back to the original questionnaire.
- Save after every batch. Use File > Save, and keep a backup copy in a different folder or cloud drive.
If your data already exists in Excel or Google Sheets, import it instead of typing: File > Open > Data, choose your file, and tick “Read variable names from the first row of data”. Check Variable View carefully after importing, because SPSS sometimes guesses types wrongly.
6. Check your data as you go — do not wait until analysis day
Data entry errors are inevitable. The question is whether you catch them now, when they are easy to fix, or during your analysis, when a single wrong value can change a p-value.
First, run Frequencies on every categorical variable: Analyse > Descriptive Statistics > Frequencies. Look for values that should not exist — a gender coded 3 when only 1 and 2 are valid, or a Likert item showing a 6. Second, run Descriptives on every scale variable: Analyse > Descriptive Statistics > Descriptives. Check the minimum and maximum of each variable against what is possible — an age of 999 means a missing code slipped through.
Finally, sort your data by each key variable (Data > Sort Cases) and eyeball the extremes, where typos hide — and spot-check every tenth participant against the original questionnaire.
SPSS syntax: set up labels, missing values, and checks in one go
Syntax records exactly what you did. Paste the block below into a syntax window (File > New > Syntax), adapt the variable names, and run it.
* Set value labels and declare missing-value codes. VALUE LABELS gender 1 'Male' 2 'Female' 3 'Prefer not to say' / educ 1 'High school' 2 'Bachelor' 3 'Master' 4 'PhD'. MISSING VALUES age (999) educ (9). EXECUTE. * Check categorical variables for impossible values. FREQUENCIES VARIABLES=gender educ /STATISTICS=MINIMUM MAXIMUM /ORDER=ANALYSIS. * Check scale variables for out-of-range values. DESCRIPTIVES VARIABLES=age score1 score2 score3 /STATISTICS=MEAN STDDEV MIN MAX.
Save this syntax file alongside your data file. If anyone asks how your data was prepared, the syntax is your answer — and if you need to redo the setup on a revised dataset, you can run the same file again instead of clicking through the menus.
7. Keep a clean master file and a working copy
Once your data is entered and checked, save it as your master copy — for example, thesis_data_MASTER.sav — and do not analyse it directly. Make a working copy for your analyses and keep the master untouched, so you can always return to it instead of re-entering data. Use dated file names for new versions, keep the master file, codebook, and syntax files together, and back that folder up.
Reporting in APA style (7th ed.)
Your methodology section should describe your data preparation briefly but completely, so a reader could reproduce it. Report the sample size after cleaning, the number of cases excluded and why, and how missing data was handled. For example: “Data were entered into IBM SPSS Statistics (Version 29). Of the 214 questionnaires returned, 6 were excluded because more than 20% of items were incomplete, leaving a final sample of 208 participants. Missing values (1.8% of all data points) were coded as user-missing values and excluded pairwise from analyses.”
Also name the checks you performed: “All variables were screened for out-of-range values using frequency distributions and descriptive statistics.” One line like this adds real credibility.
Key Takeaways
- Build a codebook before you enter anything: one row per variable, with its name, type, codes, and missing-value rule.
- Set up Variable View completely first — names, types, labels, values, missing codes, and measurement level.
- Give every categorical variable value labels, and keep your coding direction consistent across the file.
- Decide your missing-value codes in advance, and never let a missing code be mistaken for a real score.
- Enter one participant per row, one value per cell, and save and back up after every session.
- Check the data as you go with Frequencies and Descriptives — impossible values are almost always typos.
- Keep a clean master file, a working copy, and syntax that records exactly what you did.
Frequently asked questions
Should I enter data directly in SPSS or in Excel first?
Either works, but entering directly in SPSS is usually better: you define your variables once and enter codes with their labels visible. Excel is fine if several people are entering data — just import with File > Open > Data and check Variable View afterwards.
How do I fix a variable name SPSS will not accept?
Names must start with a letter, contain no spaces or special characters (except underscores), and cannot be a reserved word such as “ALL” or “BY”. Shorten the name and replace spaces with underscores — for example, “Stress Score” becomes stress_score. Keep the full wording in the Label column, where spaces are allowed.
What is the difference between system-missing and user-missing values?
A system-missing value is an empty cell, shown as a dot, which SPSS excludes automatically. A user-missing value is a code you choose, such as 999, which SPSS only excludes after you declare it in the Missing column of Variable View. Use user-missing codes when you need to distinguish reasons for missingness — for example, 999 for “skipped” and 888 for “not applicable”.
How many decimals should I use for my variables?
Use 0 decimals for whole-number codes such as Likert items and gender codes, and 2 decimals for measured values such as scores with decimal places or reaction times. Decimals only change how SPSS displays a value, not the value itself, but displaying 2 decimals on a 1–5 code clutters your output for no benefit.
Can I change a variable from string to numeric after entering data?
Yes, but not by changing the Type in Variable View — that can lose data. Use Transform > Automatic Recode to create a new numeric variable, check it against the original, and only then delete the old one. Better still, set the type correctly before you start entering data.
Need this done on your data? Get a free quote → /services/