What Is Split-File Analysis in SPSS?
Split-file analysis is one of the most useful — and most overlooked — features in SPSS. It tells SPSS to run every analysis separately for each group in your data, without you having to filter, copy, or split your dataset by hand.
Imagine you have survey data from 300 students and you want the average exam score for men and for women. Without split file, you would run the analysis twice: once with a filter for men, once with a filter for women. With split file turned on, you run the analysis once and SPSS produces two sets of output — one for each group — automatically.
That is the whole idea: split file divides your dataset into groups based on one or more grouping variables, and every procedure you run afterwards is repeated for each group until you switch it off. It works with almost every analysis in SPSS: frequencies, descriptives, t-tests, correlations, regression, charts, and more.
When Should You Use Split File?
Split file is the right tool whenever you want the same analysis repeated for different groups. Common examples include:
- Comparing groups descriptively: means and frequencies for men vs women, or for each study site, school, or treatment arm.
- Checking assumptions within groups: normality tests need to be checked separately for each group before a t-test or ANOVA.
- Running the same test per group: a correlation between study hours and exam score for first-year, second-year, and third-year students.
- Producing grouped charts: a histogram or boxplot for each category of a grouping variable.
Split file is not a substitute for a statistical test that compares groups. It will not tell you whether the groups differ significantly — for that you still need a t-test, ANOVA, or chi-square test.
Step 1: Prepare Your Grouping Variable
Before you switch split file on, check that your grouping variable is set up correctly:
- Open Variable View and find your grouping variable — for example, Gender, Group, or Site.
- Make sure it is a nominal or ordinal variable with a small number of categories (two to six groups works best). Split file with a continuous variable such as age in years would create a separate analysis for every single age value.
- Check that value labels are defined (for example, 1 = Male, 2 = Female). The labels appear in your output headings, so labelled values make the results far easier to read.
- Run Analyze > Descriptive Statistics > Frequencies on the grouping variable first, to confirm there are no unexpected categories or miscoded values.
Step 2: Turn On Split File
Follow these clicks:
- Go to Data > Split File… in the top menu.
- The Split File dialog opens. You will see three options: Analyze all cases, do not create groups (the default), Compare groups, and Organize output by groups.
- Select Compare groups if you want the results for all groups in the same table, side by side — best for comparing means across groups at a glance.
- Select Organize output by groups if you want a separate table for each group, one after another — best for longer output such as regression results, where a combined table would be hard to read.
- Move your grouping variable (for example, Gender) into the Groups Based on box. You can add more than one grouping variable — SPSS will then split by every combination of their categories.
- Click OK.
SPSS now sorts your data by the grouping variable and marks the file as split. Look at the status bar at the bottom of the Data Editor: it will say Split File On. That message is your reminder that every analysis from now on runs separately by group.
Step 3: Run Your Analysis as Normal
With split file on, run any analysis exactly as you normally would. For example, to get descriptive statistics for exam scores by gender:
- Go to Analyze > Descriptive Statistics > Descriptives…
- Move ExamScore into the Variable(s) box.
- Click Options… and tick Mean, Std. deviation, Minimum, and Maximum, then click Continue.
- Click OK.
If you chose Compare groups, the output table has one row per group, so you can compare the male and female means in a single glance. If you chose Organize output by groups, you get one complete Descriptives table for men followed by one for women, each headed with the group label.
The same principle works for charts and inferential tests: run Graphs > Chart Builder with split file on and SPSS draws one chart per group, and a correlation run with split file on produces one correlation matrix per group.
SPSS Syntax for Split File
Everything in the dialog can be done — and saved — with syntax. Using syntax is the reliable way to make your split-file work reproducible, and it makes switching split file off again a one-line job.
* Turn split file ON, comparing groups side by side.
SORT CASES BY Gender.
SPLIT FILE SEPARATE BY Gender.
* Now run any analysis - it repeats for each group.
DESCRIPTIVES VARIABLES=ExamScore
/STATISTICS=MEAN STDDEV MIN MAX.
FREQUENCIES VARIABLES=Satisfaction
/STATISTICS=MEAN MEDIAN
/ORDER=ANALYSIS.
* Turn split file OFF when you are done.
SPLIT FILE OFF.A few notes on this syntax:
- SORT CASES BY comes first — SPSS needs the data sorted by the grouping variable before it can split. The dialog does this automatically; in syntax you do it yourself.
- SPLIT FILE SEPARATE BY is the Organize output by groups option (separate tables). Use SPLIT FILE LAYERED BY for the Compare groups option (one combined table).
- SPLIT FILE OFF switches splitting off. Always include it at the end of your syntax file — forgetting it is the single most common split-file mistake (see below).
How to Interpret Split-File Output
Reading split-file output is straightforward once you know what to look for:
- Check the group headings first. With Organize output by groups, each table is headed with the group value and label (for example, “Gender = Female”). Make sure you are reading the table for the group you think you are reading.
- Check the N in each group. Every table reports how many cases contributed. If one group’s N is much smaller than expected, some cases may have missing values on the grouping variable — SPSS excludes cases with a missing group value from all split output.
- Compare across groups, but do not over-interpret. A difference between group means in split output is descriptive only. Two means that look different may not differ significantly; run the appropriate test (for example, an independent-samples t-test) to find out.
The One Mistake Everyone Makes: Forgetting to Switch It Off
Split file stays on until you switch it off. It stays on across analyses, across saved files, and across SPSS sessions if you save the data file while it is active. This catches beginners constantly: they split by gender for one analysis, then run a t-test an hour later and wonder why the output looks strange — because the t-test was run separately for men and for women instead of comparing them.
To switch it off, go to Data > Split File…, select Analyze all cases, do not create groups, and click OK. Or run SPLIT FILE OFF. in syntax. Then check the status bar: it should no longer say “Split File On”.
Make this a habit: every time you turn split file on, turn it off again as soon as that analysis is finished. If you use syntax, put SPLIT FILE OFF. at the end of every syntax file that uses splitting.
Split File vs Select Cases vs Filter: Which One Do You Need?
Beginners often confuse split file with two related features. Here is how they differ:
- Split File repeats an analysis for every group. Use it when you want results for all groups.
- Select Cases (Data > Select Cases…) temporarily excludes cases that do not meet a condition. Use it when you want to analyze only one group and ignore the rest.
- Filter marks cases as excluded but keeps them visible. It is similar to Select Cases but easier to toggle on and off in the Data Editor.
A good rule of thumb: if you find yourself running Select Cases several times in a row for different groups, you probably wanted Split File instead.
Reporting in APA Style (7th ed.)
Split file itself is a data-management step, so it is not usually something you report as a result. What you report are the group statistics it produced. A typical sentence looks like this:
Descriptive statistics were computed separately for men (n = 142, M = 68.40, SD = 9.12) and women (n = 158, M = 71.25, SD = 8.47).
When reporting group means in a table, follow APA table format: one row per group, with columns for the group label, n, M, and SD. Report means and standard deviations to two decimal places, and use italic M, SD, and n. If you went on to test the group difference, report that test separately — for example, an independent-samples t-test — and do not present the split-file descriptives as if they were the test itself.
Key Takeaways
- Split file repeats any analysis separately for each category of a grouping variable — no manual filtering or copying needed.
- Compare groups puts all groups in one table; Organize output by groups gives each group its own table.
- Your grouping variable must be categorical with a small number of labelled categories.
- The syntax is
SORT CASES BY, thenSPLIT FILE SEPARATE BY(orLAYERED BY), then your analysis — and always finish withSPLIT FILE OFF. - Split-file output is descriptive: it shows group results side by side but does not test whether groups differ.
- Always switch split file off when you are done — it stays on until you do, and it will silently change every later analysis.
Frequently Asked Questions
Does split file change my data?
No. Split file does not add, delete, or change any values. It only changes how analyses are run. Your dataset is exactly the same afterwards — the only lasting effect is that SPSS remembers the split setting until you switch it off.
Can I split by two variables at once?
Yes. Move both variables into the Groups Based on box, or list both in syntax (SPLIT FILE SEPARATE BY Gender Site.). SPSS splits by every combination of categories, so two variables with three categories each produce nine groups. Keep combinations small or the output becomes unmanageable.
Why is my output empty for one group?
Usually one of two reasons: the group has no cases in your data (check with Frequencies on the grouping variable), or cases in that group have missing values on the analysis variable. Also check that the grouping variable has no unexpected values, such as a stray code 9 for “missing” that was never declared as a missing value.
Can I use split file with regression or ANOVA?
Yes — split file works with almost every procedure, including regression, ANOVA, and t-tests. Running a regression with split file on fits a separate model for each group. Just remember that a separate model per group is not the same as testing whether the models differ; for that you need an interaction term or a formal comparison.
How do I know split file is still on?
Look at the status bar at the bottom of the SPSS Data Editor. When splitting is active it displays “Split File On”. If you are unsure, open Data > Split File… and check which option is selected — it is the fastest way to confirm before you run your next analysis.
Need this done on your data? Get a free quote → /services/