27.03.2013 Views

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SEPARATOR Subcommand<br />

CASESTOVARS 187<br />

CASESTOVARS creates variable groups that contain new variables. There are two parts to the<br />

name of a new variable—a rootname and an index. The parts are separated by a string. The<br />

separator string is specified on the SEPARATOR subcommand.<br />

• If a separator is not specified, the default is a period.<br />

• A separator can contain multiple characters.<br />

• The separator must be delimited by apostrophes or quotation marks.<br />

• You can suppress the separator by specifying /SEPARATOR="".<br />

GROUPBY Subcommand<br />

The GROUPBY subcommand controls the order of the new variables in the new data file.<br />

VARIABLE Group new variables by original variable. The procedure groups all variables<br />

created from an original variable together. This is the default.<br />

INDEX Group new variables by index variable. The procedure groups variables<br />

according to the index variables.<br />

Example<br />

If the original variables are:<br />

insure caseid month bps bpd<br />

and the data are as shown in the first example, the commands:<br />

SPLIT FILE BY insure.<br />

CASESTOVARS<br />

/ID=caseid<br />

/INDEX=month<br />

/GROUPBY=VARIABLE.<br />

create a new data file with the following variable order:<br />

insure caseid bps.1 bps.2 bps.3 bpd.1 bpd.2 bpd.3<br />

• Variables are grouped by variable group—bps and bpd.<br />

Example<br />

Using the same original data, the commands:<br />

SPLIT FILE BY insure.<br />

CASESTOVARS<br />

/ID=insure caseid<br />

/INDEX=month<br />

/GROUPBY=INDEX.<br />

create a new data file with the following variable order:<br />

insure caseid bps.1 bpd.1 bps.2 bpd.2 bps.3 bpd.3<br />

• Variables are grouped by values of the index variable month—1, 2, and 3.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!