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.

1654 VARSTOCASES<br />

COUNT Subcommand<br />

When there are no null data, VARSTOCASES generates n new rows for each row in the original<br />

data file, where n is the number of variables on the FROM list(s). When the original data<br />

file contains null values and you drop them, it is possible to generate a different number of<br />

rows for a given subject in the original data file. The COUNT subcommand creates a new<br />

variable that contains the number of new rows generated by the original subject.<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 variable is F4.0.<br />

DROP and KEEP Subcommands<br />

The DROP and KEEP subcommands are used to include only a subset of variables in the new<br />

working file. The DROP subcommand specifies a set of variables to exclude and the KEEP<br />

subcommand specifies a set of variables to retain. Variables not specified on the KEEP<br />

subcommand are dropped.<br />

• DROP and KEEP cannot be used with variables that appear on a FROM list.<br />

• DROP and KEEP are mutually exclusive. Only one DROP or one KEEP subcommand can<br />

be used on the VARSTOCASES command.<br />

• KEEP affects the order of variables in the new data file. The order of the variables kept in<br />

the new data file is the order in which they are named on the KEEP subcommand.<br />

Example<br />

VARSTOCASES<br />

/MAKE newvar FROM var1 to var4<br />

/DROP caseid.<br />

• Caseid is dropped from the new data file. The new data file contains one variable,<br />

newvar.

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

Saved successfully!

Ooh no, something went wrong!