Next: FLIP, Previous: COMPUTE, Up: Data Manipulation [Contents][Index]
COUNT var_name = var… (value…)
[/var_name = var… (value…)]…
Each value takes one of the following forms:
number
string
num1 THRU num2
MISSING
SYSMIS
where num1 is a numeric expression or the words LO or LOWEST
and num2 is a numeric expression or HI or HIGHEST.
COUNT creates or replaces a numeric target variable that
counts the occurrence of a criterion value or set of values over
one or more test variables for each case.
The target variable values are always nonnegative integers. They are never missing. The target variable is assigned an F8.2 output format. See Input and Output Formats. Any variables, including string variables, may be test variables.
User-missing values of test variables are treated just like any other
values. They are not treated as system-missing values.
User-missing values that are criterion values or inside ranges of
criterion values are counted as any other values. However (for numeric
variables), keyword MISSING may be used to refer to all system-
and user-missing values.
COUNT target variables are assigned values in the order
specified. In the command COUNT A=A B(1) /B=A B(2)., the
following actions occur:
Despite this ordering, all COUNT criterion variables must exist
before the procedure is executed—they may not be created as target
variables earlier in the command! Break such a command into two
separate commands.
The examples below may help to clarify.
Q0, Q2, …, Q9 are numeric variables,
the following commands:
QCOUNT.
DESCRIPTIVES. See DESCRIPTIVES, for
details.
COUNT QCOUNT=Q0 TO Q9(1). DESCRIPTIVES QCOUNT /STATISTICS=SUM.
QVALID.
QVALID by 10 to obtain a percentage of
valid values, using COMPUTE. See COMPUTE, for details.
DESCRIPTIVES. See DESCRIPTIVES, for details.
COUNT QVALID=Q0 TO Q9 (LO THRU HI). COMPUTE QVALID=QVALID*10. DESCRIPTIVES QVALID /STATISTICS=MEAN.
Next: FLIP, Previous: COMPUTE, Up: Data Manipulation [Contents][Index]