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.

COUNT<br />

COUNT varname=varlist(value list) [/varname=...]<br />

Keywords for numeric value lists:<br />

LOWEST, LO, HIGHEST, HI, THRU, MISSING, SYSMIS<br />

Example<br />

Overview<br />

COUNT TARGET=V1 V2 V3 (2).<br />

COUNT creates a numeric variable that, for each case, counts the occurrences of the same<br />

value (or list of values) across a list of variables. The new variable is called the target<br />

variable. The variables and values that are counted are the criterion variables and values.<br />

Criterion variables can be either numeric or string.<br />

Basic Specification<br />

The basic specification is the target variable, an equals sign, the criterion variable(s), and<br />

the criterion value(s) enclosed in parentheses.<br />

<strong>Syntax</strong> Rules<br />

• Use a slash to separate the specifications for each target variable.<br />

• The criterion variables specified for a single target variable must be either all numeric or<br />

all string.<br />

• Each value on a list of criterion values must be separated by a comma or space. String<br />

values must be enclosed in apostrophes.<br />

• The keywords THRU, LOWEST (LO), HIGHEST (HI), SYSMIS, and MISSING can be used<br />

only with numeric criterion variables.<br />

• A variable can be specified on more than one criterion variable list.<br />

• You can use the keyword TO to specify consecutive criterion variables that have the<br />

same criterion value or values.<br />

• You can specify multiple variable lists for a single target variable to count different values<br />

for different variables.<br />

291

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

Saved successfully!

Ooh no, something went wrong!