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.

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

insure ind1 ind2 ind3 bps.1 bps.2 bps.3<br />

BCBS 1 0 0 160 . .<br />

BCBS 1 1 0 120 130 .<br />

Prucare 1 1 1 160 120 180<br />

Prucare 1 0 0 135 . .<br />

CASESTOVARS 185<br />

• The command created three new indicator variables—one for each unique value of the index<br />

variable month.<br />

COUNT Subcommand<br />

CASESTOVARS consolidates row groups in the original data into a single row in the new data<br />

file. The COUNT subcommand creates a new variable that contains the number of rows in the<br />

original data that were used to generate the row in the new data file.<br />

• One new variable is named on the COUNT subcommand. It must have a unique name.<br />

• The label for the new variable is optional and, if specified, must be delimited by<br />

apostrophes or quotation marks.<br />

• The format of the new count variable is F4.0.<br />

Example<br />

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

SPLIT FILE BY insure.<br />

CASESTOVARS<br />

/ID=caseid<br />

/COUNT=countvar<br />

/DROP=insure month bpd.<br />

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

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

1 1 160 . .<br />

2 2 120 130 .<br />

1 3 160 200 180<br />

2 1 135 . .<br />

• The command created a count variable, countvar, which contains the number of rows in<br />

the original data that were used to generate the current row.<br />

FIXED Subcommand<br />

The FIXED subcommand names the variables that should be copied from the original data to<br />

the new data file.<br />

• CASESTOVARS assumes that variables named on the FIXED subcommand do not vary<br />

within row groups in the original data. If they vary, a warning message is generated and<br />

the command is executed.

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

Saved successfully!

Ooh no, something went wrong!