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.

184 CASESTOVARS<br />

INDEX Subcommand<br />

In the original data, a variable appears in a single column. In the new data file, that variable<br />

will appear in multiple new columns. The INDEX subcommand names the variables in the<br />

original data that should be used to create the new columns. INDEX variables are also used to<br />

name the new columns.<br />

Optionally, with the GROUPBY subcommand, INDEX variables can be used to determine<br />

the order of the new columns, and, with the VIND subcommand, INDEX variables can be used<br />

to create indicator variables.<br />

• String variables can be used as index variables. They cannot contain blank values for rows<br />

in the original data that qualify for inclusion in the new data file.<br />

• Numeric variables can be used as index variables. They must contain only non-negative<br />

integer values and cannot have system-missing or blank values.<br />

• Within each row group in the original file, each row must have a different combination<br />

of values of the index variables.<br />

• If the INDEX subcommand is not used, the index starts with 1 within each row group and<br />

increments each time a new value is encountered in the original variable.<br />

• Variables listed on the INDEX subcommand may not appear on the ID, FIXED, or DROP<br />

subcommands.<br />

• Index variables are not are not candidates to become a variable group in the new data file.<br />

VIND Subcommand<br />

The VIND subcommand creates indicator variables in the new data file. An indicator variable<br />

indicates the presence or absence of a value for a case. An indicator variable has the value of<br />

1 if the case has a value; otherwise, it is 0.<br />

• One new indicator variable is created for each unique value of the variables specified on<br />

the INDEX subcommand.<br />

• If the INDEX subcommand is not used, an indicator variable is created each time a new<br />

value is encountered within a row group.<br />

• An optional rootname can be specified after the ROOT keyword on the subcommand. The<br />

default rootname is ind.<br />

• The format for the new indicator variables is F1.0.<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 />

/VIND<br />

/DROP=caseid bpd.

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

Saved successfully!

Ooh no, something went wrong!