Examples (SPLIT FILE command)
Sorting and Splitting a File
SORT CASES BY SEX.
SPLIT FILE BY SEX.
FREQUENCIES VARS=INCOME /STATISTICS=MEDIAN.
-
SORT CASES
arranges cases in the file according to the values of variable SEX. -
SPLIT FILE
splits the file according to the values of variable SEX, andFREQUENCIES
generates 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
TEMPORARY
command,SPLIT FILE
applies to the first procedure only. Thus, the firstFREQUENCIES
procedure generates separate tables for men and women. The secondFREQUENCIES
procedure 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 FILE
does not apply to the secondFREQUENCIES
procedure because it is turned off after the firstFREQUENCIES
procedure. 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 FILE
command applies to the firstFREQUENCIES
procedure. The secondSPLIT FILE
command overrides the first command and splits the file by sex and race. This split is in effect for the secondFREQUENCIES
procedure.