How To Split A File In SPSS

0
439

What is the Split File command?

The Split File command is used to separate the output of SPSS tests according to a group variable. The best example would be to split the output according to sex. By doing this in SPSS, through the use of the Split File command, you will get two separate outputs for subsequent analyses, one for males and the other for females.

To be able to perform a split file command, you must have a grouping (nominal) variable, such as sex (male/female), age (young/old), treatment group (control/treated) etc. There can be more than two groups within the variable.

How to use the Split File command in SPSS

1. To use the Split File command within SPSS, firstly go to ‘Data > Split File …‘.

SPSS Split File2. A new window should open. Here, select the ‘Organize output by groups‘ option. Now you can drag the grouping variable you want to split the file by into the box called ‘Groups Based on:‘.

SPSS Split File OptionIn the above example, I am wanting to split the SPSS output by the ‘Sex‘ variable.

3. Click the ‘OK‘ button. Any analyses performed from now on will be split into separate outputs based on the grouping variable.

How to use the Split File command in SPSS (Syntax)

1. To use the Split File command via the Syntax window, firstly open up a Syntax sheet by going to ‘File > New > Syntax‘.

2. In the Syntax window, enter the following command:

SORT CASES BY [grouping variable].
SPLIT FILE SEPARATE BY [grouping variable].

Replace the ‘[grouping variable]‘ with the name of the grouping variable. Note, the ‘SORT CASES‘ function must be applied first to sort the data by the grouping variable, or else the Split File may not work correctly.

As used in the example above, this would be:

SPSS Split File Syntax3. Run the commands by going to ‘Run > All‘.

How to remove the Split File command

1. To remove the Split File command, go to ‘Data > Split File …‘.

2. In the Split File window, select the ‘Analyze all cases, do not create groups‘ option.

SPSS Split File remove option3. Click the ‘OK‘ button. The Split File command has now been removed and the data file returned to default.

How to remove the Split File command (Syntax)

1. To remove the Split File command via the Syntax window, firstly open up a Syntax sheet by going to ‘File > New > Syntax‘.

2. In the Syntax window, enter the following command:

SPLIT FILE Off.

Here is the command within the Syntax document.

Split File Syntax Off3. Run the commands by going to ‘Run > All‘.

LEAVE A REPLY

Please enter your comment!
Please enter your name here