GROUPBY subcommand (CASESTOVARS command)
The GROUPBY
subcommand controls the order of the new variables in the new data
file.
VARIABLE. Group new variables by original variable. The procedure groups all variables created from an original variable together. This is the default.
INDEX. Group new variables by index variable. The procedure groups variables according to the index variables.
Example
If the original variables are:
insure caseid month bps bpd
and the data are as shown in the first example, the commands:
SPLIT FILE BY insure.
CASESTOVARS
/ID=caseid
/INDEX=month
/GROUPBY=VARIABLE.
create a new data file with the following variable order:
- Variables are grouped by variable group—bps and bpd.
Example
Using the same original data, the commands:
SPLIT FILE BY insure.
CASESTOVARS
/ID=insure caseid
/INDEX=month
/GROUPBY=INDEX.
create a new data file with the following variable order:
- Variables are grouped by values of the index variable month—1, 2, and 3.