Examples (SPLIT FILE command)
Sorting and Splitting a File
SORT CASES BY SEX.
SPLIT FILE BY SEX.
FREQUENCIES VARS=INCOME /STATISTICS=MEDIAN.
-
SORT CASESarranges cases in the file according to the values of variable SEX. -
SPLIT FILEsplits the file according to the values of variable SEX, andFREQUENCIESgenerates separate median income tables for men and women. - By default, the two groups (men and women) are compared in the same Frequency and Statistics tables.
Applying a Temporary Split File
SORT CASES BY SEX.
TEMPORARY.
SPLIT FILE SEPARATE BY SEX.
FREQUENCIES VARS=INCOME /STATISTICS=MEDIAN.
FREQUENCIES VARS=INCOME /STATISTICS=MEDIAN.
- Because of the
TEMPORARYcommand,SPLIT FILEapplies to the first procedure only. Thus, the firstFREQUENCIESprocedure generates separate tables for men and women. The secondFREQUENCIESprocedure generates tables that include both sexes.
Turning Off a Split File
SORT CASES BY SEX.
SPLIT FILE SEPARATE BY SEX.
FREQUENCIES VARS=INCOME /STATISTICS=MEDIAN.
SPLIT FILE OFF.
FREQUENCIES VARS=INCOME /STATISTICS=MEDIAN.
-
SPLIT FILEdoes not apply to the secondFREQUENCIESprocedure because it is turned off after the firstFREQUENCIESprocedure. This example produces the same results as the example above.
Overriding a Previous Split File
SORT CASES BY SEX RACE.
SPLIT FILE BY SEX.
FREQUENCIES VARS=INCOME /STATISTICS=MEDIAN.
SPLIT FILE BY SEX RACE.
FREQUENCIES VARS=INCOME /STATISTICS=MEDIAN.
- The first
SPLIT FILEcommand applies to the firstFREQUENCIESprocedure. The secondSPLIT FILEcommand overrides the first command and splits the file by sex and race. This split is in effect for the secondFREQUENCIESprocedure.