SPSS Count

The COUNT command sets a variable equal to the frequency of some value across a case.


Usage

count foo = foo1 foo2 foo3 (1)
  /bar = bar1 (1, 2)
  /baz = baz1 baz2 baz3 ("1").

Each computed variable takes a target variable list following an equals sign (=) and a parenthesized target values list. Each target variable list must be either all numeric or all strings. Each computed variable will be numeric with F8.2 format and receive a non-negative integer.

Ranges are valid for numeric variables. They are inclusive and capture non-integers.

count foo = bar baz (1 thru 2).

The LO/LOWEST and HI/HIGHEST keywords dynamically capture the lowest and highest non-missing values. These keywords are only valid on ranges.

The SYSMIS keyword captures system missing values, while the MISSING keyword captures both user missing and system missing values.

If a string literal or string expression differs in length compared to the target variable, it is truncated or padded with space characters as needed.


Data Model

The COUNT command is queued as a pending transformation.


See also

PSPP manual for COUNT


CategoryRicottone

SPSS/Count (last edited 2023-06-14 20:01:13 by DominicRicottone)